mscallisto
Technical User
I'm stuck on syntax and need some assistance
Code:
Sub CleanUpData()
Dim intLastRow As Integer
intLastRow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
' Delete all un-needed rows
For Ii = 1 To intLastRow - 1
If Rows(Ii).Columns(5).Interior.ColorIndex <> 5 Then
[Red]'I want to delete from this row forward
'and the following 2 lines of code don't work.[/red]
[b]Rows(Ii).Select
Selection.Delete[/b]
'[red]Plus I really don't want to continue looping but simply:
'Rows(Ii:toLastRow).delete and exit the loop[/red]
End If
Next Ii