1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Option Explicit
Private Sub Workbook_Open()
With Feuil1
.Activate
.Range("A1").Select
.Columns("A:A").Interior.ColorIndex = xlNone
End With
RchDate
End Sub
Private Sub RchDate()
Dim LastRow As Long, c As Range
LastRow = Feuil1.Range("A" & Rows.Count).End(xlUp).Row
With Feuil1.Range("A1:A" & LastRow)
Set c = .Find(What:=Date, After:=ActiveCell, LookIn:=xlFormulas, SearchDirection:=xlNext, MatchCase:=True)
If Not c Is Nothing Then
With c.Offset(-1)
.Select
.Interior.ColorIndex = 36
End With
Else
MsgBox "la Date Courante -1" & vbCrLf & "correspond à un Samedi, Dimanche ou Jour Férié", vbInformation + vbOKOnly, "Attention"
End If
End With
End Sub |