S
sev
Guest
Bon week end à tous ,
Je voudrais isoler des cellules (A36:F38) contenant des informations pour qu'elles ne parasitent pas l'action du code suivant :
[CODEPrivate Sub RunFormat_TextBox9(ByRef MyCell As Range) 'TRAIN ROSE
With MyCell
With .Font
MyCellFont = .Name
MyCellFontSize = .Size
MyCellFontColor = .Color
MyCellBold = .Bold
MyCellItalic = .Italic
MyCellUnderLine = .Underline
MyCellValue = MyCell.Value
End With
With Me.TextBox9
With .Font
.Name = MyCellFont
.Bold = MyCellBold
.Italic = MyCellItalic
.Size = MyCellFontSize
End With
.ForeColor = MyCellFontColor
.Value = Format(MyCellValue, "0# ##")
End With
Me.CommandButton2.Visible = True
End With
End Sub
Private Sub RunFormat_TextBox38(ByRef MyCell As Range) 'CASE ROSE
With MyCell
With .Font
MyCellFont = .Name
MyCellFontSize = .Size
MyCellFontColor = .Color
MyCellBold = .Bold
MyCellItalic = .Italic
MyCellUnderLine = .Underline
MyCellValue = MyCell.Value
End With
With Me.TextBox38
With .Font
.Name = MyCellFont
.Bold = MyCellBold
.Italic = MyCellItalic
.Size = MyCellFontSize
End With
.ForeColor = MyCellFontColor
.Value = Application.Replace(MyCellValue, 2, 0, " ")
End With
Me.CommandButton2.Visible = True
End With
End Sub
][/CODE]
Je voudrais isoler des cellules (A36:F38) contenant des informations pour qu'elles ne parasitent pas l'action du code suivant :
Code:
Private Sub TextBox4_Change() 'BUS ROSE
TextBox12.Value = ""
TextBox13.Value = ""
TextBox9.Value = ""
TextBox38.Value = ""
TextBox66.Value = ""
Dim MyVar As Long
Dim MyRange As Range, MyCell As Range
With Me.TextBox4
Select Case Len(.Value)
Case 3, 5
MyVar = Val(.Value)
Case Else
Exit Sub
End Select
End With
With Sheets("ROSE")
Set MyRange = Union(.Range(.Range("C6"), .Range("A50").End(xlUp)), _
.Range(.Range("H6"), .Range("H50").End(xlUp)), _
.Range(.Range("M6"), .Range("M50").End(xlUp)), _
.Range(.Range("R6"), .Range("R50").End(xlUp)))
End With
For Each MyCell In MyRange
If Val(MyCell) = Val(MyVar) Then
RunFormat_TextBox9 MyCell.Offset(0, -1)
RunFormat_TextBox38 MyCell.Offset(0, 2)
Exit Sub
End If
Next
End Sub
With MyCell
With .Font
MyCellFont = .Name
MyCellFontSize = .Size
MyCellFontColor = .Color
MyCellBold = .Bold
MyCellItalic = .Italic
MyCellUnderLine = .Underline
MyCellValue = MyCell.Value
End With
With Me.TextBox9
With .Font
.Name = MyCellFont
.Bold = MyCellBold
.Italic = MyCellItalic
.Size = MyCellFontSize
End With
.ForeColor = MyCellFontColor
.Value = Format(MyCellValue, "0# ##")
End With
Me.CommandButton2.Visible = True
End With
End Sub
Private Sub RunFormat_TextBox38(ByRef MyCell As Range) 'CASE ROSE
With MyCell
With .Font
MyCellFont = .Name
MyCellFontSize = .Size
MyCellFontColor = .Color
MyCellBold = .Bold
MyCellItalic = .Italic
MyCellUnderLine = .Underline
MyCellValue = MyCell.Value
End With
With Me.TextBox38
With .Font
.Name = MyCellFont
.Bold = MyCellBold
.Italic = MyCellItalic
.Size = MyCellFontSize
End With
.ForeColor = MyCellFontColor
.Value = Application.Replace(MyCellValue, 2, 0, " ")
End With
Me.CommandButton2.Visible = True
End With
End Sub
][/CODE]