
Originally Posted by
TMShucks
Delete from the bottom up :-)
For Cnt = 505 to 1 step -1
You might need to adjust your logic ... maybe, step -5
Regards
Excellent, thank you. I didn't realize you could do that, maybe VB isn't so horrible after all.
For anyone who is interested, this is the working code. (I hate googling & finding these posts with no solution posted at the end.)
Sub Change()
Dim Row As Integer
Dim DeleteFlag As Integer
DeleteFlag = 1
For Row = 505 To 1 Step -1
bgrange = "A" & Row & ":BB" & Row
If DeleteFlag > 5 Then
DeleteFlag = 1
End If
If DeleteFlag = 4 Or DeleteFlag = 5 Then
DeleteFlag = DeleteFlag + 1
Else
DeleteFlag = DeleteFlag + 1
'Cells(Row, 2).Value = DeleteFlag
'Range(bgrange).Interior.Color = RGB(255, 0, 0)
Range("A" & Row).EntireRow.Delete
End If
Next
End Sub
Bookmarks