Place this code in the Code Page for the Worksheet in question
Dim celStartDate As Range
Dim celEndDate As Range
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Set celStartDate = Range("A1") 'Adjust as needed
Set celEndDate = Range("B1") 'Adjust as needed
If Intersect(Target, celStartDate, celEndDate) Is Nothing Then
Set celStartDate = Nothing
Set celEndDate = Nothing
Exit Sub
End If
SetDateColors
End Sub
Private Sub SetDateColors()
Dim rngDates As Range
Dim FirstCell As Range
Dim LastCell As Range
Dim Cel As Range
'Uncomment after testing
'Application.Screenupdating = False
Set FirstCell = Cells(2, "A") 'Adjust 2 = Row of top of dates, "A" = Dates Column
Set LastCell = Cells(Rows.Count, "A").End(xlUp) 'Adjust "A" to Dates column
For Each Cel In Range(FirstCell, LastCell)
If Cel >= celStartDate And Cel <= celEndDate Then
Cel.Interior.ColorIndex = 3
Else
Cel.Interior.ColorIndex = xlAutomatic
End If
Next Cel
Application.ScreenUpdating = True
End Sub