I have created the following sub programs. However if I click button after changes to worksheet the cell fonts don't change. I know the first program is working as I've used msgbox and everytime I click on sheet it displays message.
vb Code:
Option Explicit
Dim rngChanged As Range
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Target <> "" Then
If Not Intersect(Range("E8:J26"), Target) Is Nothing Then
If rngChanged Is Nothing Then
Set rngChanged = Target
Else
Set rngChanged = Union(rngChanged, Target)
End If
End If
End If
End If
End Sub
Private Sub CommandButton1_Click()
Dim cel As Range
If Not rngChanged Is Nothing Then
For Each cel In rngChanged
If IsDate(cel) Then cel.Font.Color = vbRed
Next cel
Set rngChanged = Nothing
End If
End Sub