Simplification de formule

hello

comment simplifier cette commande vba

merci

Dim i, a, b, c As Integer

With Worksheets("Feuil1")

Dim thisDate As String
thisDate = Format$(Date, "dd/mm/yyyy")
For i = 7 To 9




If Cells(i, "j") > thisDate And Cells(i, "j") <> "" Then

Cells(i, "a").Interior.Color = RGB(128, 255, 128)
Cells(i, "b").Interior.Color = RGB(128, 255, 128)
Cells(i, "c").Interior.Color = RGB(128, 255, 128)

End If

Bonjour,

C'est difficile de te dire, avec juste un bout de code...

Peut-être comme ça :

Sub test()
Dim i, a, b, c As Integer
For i = 7 To 9
    If CDate(Cells(i, "j").Value) > Date Then
        Cells(i, "a").Interior.Color = RGB(128, 255, 128)
        Cells(i, "b").Interior.Color = RGB(128, 255, 128)
        Cells(i, "c").Interior.Color = RGB(128, 255, 128)
    End If
Next
End Sub

A+

en fait j aimerai toute la ligne i de A a C sachant que BC sont fusionnées

probleme resolu

Cells(i, "a").Interior.Color = RGB(211, 211, 211)
Range("b" & i).MergeArea.Interior.Color = RGB(211, 211, 211)

ou encore :

Range(Cells(i,1),Cells(i,2)).Interior.Color = RGB(211, 211, 211)

A+

Rechercher des sujets similaires à "simplification formule"