graemeal
Active Member
- Joined
- May 17, 2007
- Messages
- 316
- Platform
- Windows
I would like to change the range from A1:A2 to B5:C9. Changing the range at the bottom has no effect. I have very limited knowledge on how code works.
Thanks
WIN7 Excel 2007
In module
In Sheet
Thanks
WIN7 Excel 2007
In module
Code:
Public a1n2(1) As Variant
Public t As Range
Public Sub revintcol()
t.Interior.ColorIndex = -4142
Set t = Nothing
End Sub
In Sheet
Code:
Private Sub Worksheet_Calculate()
If Cells(1, 1) > a1n2(0) Then
Cells(1, 1).Interior.Color = vbGreen
ElseIf Cells(1, 1) < a1n2(0) Then Cells(1, 1).Interior.Color = vbRed
ElseIf Cells(2, 1) > a1n2(1) Then Cells(2, 1).Interior.Color = vbGreen
ElseIf Cells(2, 1) < a1n2(1) Then Cells(2, 1).Interior.Color = vbRed
End If
a1n2(0) = Cells(1, 1)
a1n2(1) = Cells(2, 1)
st = Timer + 0.2
Do Until Timer > st
Loop
Range("A1:A2").Interior.ColorIndex = -4142
End Sub