Function InRange(Range1 As Range, Range2 As Range) As Boolean
' returns True if Range1 is within Range2
Dim InterSectRange As Range
Set InterSectRange = Application.Intersect(Range1, Range2)
InRange = Not InterSectRange Is Nothing
Set InterSectRange = Nothing
End Function
Sub ColourChange2()
If InRange(ActiveCell, Range("U2:FO1000")) Then
With Range("A2:A1000")
.Font.ColorIndex = 1
End With
With Range("U1:FO1")
.Font.ColorIndex = 1
End With
Range("A" & ActiveCell.Row).Font.ColorIndex = 4
With Cells(1, Selection.Column)
.Font.ColorIndex = 4
End With
Else
With Range("A2:A1000")
.Font.ColorIndex = 1
End With
With Range("U1:FO1")
.Font.ColorIndex = 1
End With
End If
End Sub