excel – I keep getting an overflow error with this code, anyone know what I am doing wrong
Thought this was right but keep getting errors, need to loop through about 150000 rows in a column and not every row has data or data that is the same but the cells are color coded so that is why I am targeting them, but keep getting overflow error. Any help would be appreciated.
Dim rcell As Range
For Each rcell In Range("M1:M150000")
If rcell.Interior.ColorIndex = 6 Then
rcell.Offset(1, 0).Value = rcell.Value
rcell.Value = ""
rcell.Offset(1, 0).Interior.ColorIndex = 4
End If
Next rcell
Read more here: Source link