Sub Reflector()
Dim i As Integer
Dim endRow As Integer
endRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("G2").Select
For i = 2 To 40
Range("G" & i).Select
If Range("H" & i).Value = "1" Or Range("H" & i).Value = "-1" Then
ActiveCell.Formula = "=ROW(A1)"
ActiveCell.AutoFill Destination:=Range(ActiveCell.Address & ":G" & endRow)
End If
Next i
End Sub
What I'd like is for the Macro to check values in column H and keep a tally of times it has NOT -1 or 1 then write that tally in column G. If it hits a value with 1 or -1 in column G, I'd like it to restart the count there.
The process is that I will check Column H and autofill to last row of data and "bounce back up" to check the next value and then autofill again if it meets a 1 or -1.
Here is the error I get: