I want to write a VBA code that applies to 1000
rows in excel. And in each row, once I change the cell value in column G
to No
, the respective row (i.e. column H-Z
) will fill in with X
automatically.
I tried to write the code below, but it doesn't work all the time, only appear occasionally, can someone help me with this, please?
Private Sub Worksheet_Change(ByVal Target As Range)
'MsgBox Target.Address
If Not Application.Intersect(Range("B1:B100"), Range(Target.Address)) Is Nothing Then
Call Change_value
End If
End Sub
Sub Change_value()
If ActiveCell.Value = "No" Then
Cells(ActiveCell.Row, 4).Value = "Ok"
End If
End Sub