Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim bGreaterThantext As Boolean
Range("G2").Select
If ActiveCell.Value = "text" Then bGreaterThantext = True
'other statements
If bGreaterThantext Then
Selection.Font.ColorIndex = 5
End If
End Sub