Sirberthoult
XLDnaute Occasionnel
Bonjour le forum,
j'ai ecris un code qui doit s'appliquer apres 12h, qui ne fonctionne pas mais je ne comprend pas pourquoi...
pouvez vous m'aider ?
Merci
j'ai ecris un code qui doit s'appliquer apres 12h, qui ne fonctionne pas mais je ne comprend pas pourquoi...
pouvez vous m'aider ?
VB:
Private Sub Workbook_Open()
Dim plage As Range
Dim cellule As Range
Dim plage2 As Range
Dim cellule2 As Range
If Hour(Now) > 12 Then
Set plage = Range("Q15:S16")
For Each cellule In plage
If cellule.Interior.Pattern = xlSolid Then
With cellule.Interior
.Pattern = xlGray8
End With
End If
Next cellule
Set plage2 = Range("AF15:AH16")
For Each cellule2 In plage
If cellule2.Interior.Pattern = xlGray8 Then
With cellule2.Interior
.Pattern = xlSolid
End With
End If
Next cellule2
End if
End sub
Merci