Hi,
I need to combine:-
Private Sub Worksheet_Change(ByVal Target As Range)
Set MyPlage = Range("C3:M368")
For Each Cell In MyPlage
If Cell.Value = "S" Then
Cell.Interior.ColorIndex = 38
End If
If Cell.Value = "H" Then
Cell.Interior.ColorIndex = 35
End If
If Cell.Value = "PM" Then
Cell.Interior.ColorIndex = 35
End If
If Cell.Value = "AM" Then
Cell.Interior.ColorIndex = 35
End If
If Cell.Value <> "H" And Cell.Value <> "S" And Cell.Value <> "AM" And Cell.Value <> "PM" Then
Cell.Interior.ColorIndex = xlNone
End If
Next
End Sub
and
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$B3=""Saturday"""
Selection.FormatConditions(1).Interior.ColorIndex = 41
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$B3=""Sunday"""
Selection.FormatConditions(2).Interior.ColorIndex = 41