Need help on creating a macro for this scenario, I hope this to automatically run as I change value.
If I enter 5 on C2 the macro should put "X" on D2:H2
If I enter 3 on H3 the macro should put "X" on I3:K3
This i currently what I have but it is hanging for some reason.
If I enter 5 on C2 the macro should put "X" on D2:H2
If I enter 3 on H3 the macro should put "X" on I3:K3
This i currently what I have but it is hanging for some reason.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
x = ActiveCell.Value
For i = 1 To x
ActiveCell.Offset(-1, i).Value = i
Next i
End Sub