I have the following code simply to delete certain rows based on certain conditions. it all works according to plan, however when I have about 2,000 rows, in can take a couple of minutes. I am sure this is down to the way I have written the code. Can anyone see from the below a quicker way of achieving this please ?
----------------------------------------------------------------------------
For I = finalrow To 3 Step -1
'SOURCE CODE REMOVAL
If Cells(I, 13) = "AST" Or Cells(I, 13) = "SST" Then
Range(Cells(I, 2), Cells(I, 14)).Delete
End If
'PAGE SPLIT HEADERS REMOVAL
If Left(Cells(I, 2), 4) = "DATE" Or Left(Cells(I, 2), 6) = "TF BKG" Then
Range(Cells(I, 2), Cells(I, 14)).Delete
End If
'SUPPLIER CODE REMOVAL
If Cells(I, 9) = "C2A" Then
Range(Cells(I, 2), Cells(I, 14)).Delete
End If
'TOUR CODE REMOVAL
If Cells(I, 14) = "WEDING" Then
Range(Cells(I, 2), Cells(I, 14)).Delete
End If
Next I
--------------------------------------------------------------------------
Thanks
----------------------------------------------------------------------------
For I = finalrow To 3 Step -1
'SOURCE CODE REMOVAL
If Cells(I, 13) = "AST" Or Cells(I, 13) = "SST" Then
Range(Cells(I, 2), Cells(I, 14)).Delete
End If
'PAGE SPLIT HEADERS REMOVAL
If Left(Cells(I, 2), 4) = "DATE" Or Left(Cells(I, 2), 6) = "TF BKG" Then
Range(Cells(I, 2), Cells(I, 14)).Delete
End If
'SUPPLIER CODE REMOVAL
If Cells(I, 9) = "C2A" Then
Range(Cells(I, 2), Cells(I, 14)).Delete
End If
'TOUR CODE REMOVAL
If Cells(I, 14) = "WEDING" Then
Range(Cells(I, 2), Cells(I, 14)).Delete
End If
Next I
--------------------------------------------------------------------------
Thanks