G
Guest
Hello,
I'm new to programming in Excel and I'm trying to learn how to write VB in
Excel and then run the macro. I'm using Excel 2003 and I'm trying to start
with something simple. Here is what I'm trying but I think there is a syntex
error:
I'm trying to change the color background for cell G4 based on the value of
cell F4. If G4 is less than F4, I want the background of G4 to change to Red
indicating this cell is not completed. If it is = to F4, I want G4
background to change to Green indicating it is completed.
Here is my code:
If (F4 < G4) Then G4.Background = vbRed
Else: G4.Background = vbGreen
End If
Thanks in advance from your help.
I'm new to programming in Excel and I'm trying to learn how to write VB in
Excel and then run the macro. I'm using Excel 2003 and I'm trying to start
with something simple. Here is what I'm trying but I think there is a syntex
error:
I'm trying to change the color background for cell G4 based on the value of
cell F4. If G4 is less than F4, I want the background of G4 to change to Red
indicating this cell is not completed. If it is = to F4, I want G4
background to change to Green indicating it is completed.
Here is my code:
If (F4 < G4) Then G4.Background = vbRed
Else: G4.Background = vbGreen
End If
Thanks in advance from your help.