Macro to update value

Scottie31

Registered User.
Local time
, 21:31
Joined
Jan 11, 2006
Messages
30
I have a spreadsheet with almost 4000 rows and 200 cells which need to have their value changed to "0" if the adjacent cell has an "X" in it.

John 50 active
John 50 closed X
Sue 40 active
Mike 80 closed
Bill 52 active
Bill 52 closed X

If the row has an "X", I need to change the value in column B to "0".

Any help wouldbe appreciated.
 
Code:
Sub changeB()
Dim r As Long
For r = 1 To Cells(65536, 2).End(xlUp).Row
If Cells(r, 4) = "x" Then
Cells(r, 2) = 0
End If
Next r
End Sub

Brian
 

Users who are viewing this thread

Back
Top Bottom