I have this sub that is supposed to move any rows with 'ERROR' in column 33 to a new row in the ERRORS sheet
For some reason it only does the first one and i cant figure out why.
It also doesnt delete the row it has cut from in the IMPORT sheet.
Can anyone see where the problem is?
Or perhaps a better way of doing it?
'move all rows with 'ERROR' in column 33 to the ERRORS sheet
Sheets("ERRORS").Select
lastrowE = ActiveSheet.UsedRange.Rows.Count + 1
Sheets("ImportSheet").Select
lastrowI = ActiveSheet.UsedRange.Rows.Count
firstrowI = 5
For x = firstrowI To lastrowI
If Left(Cells(x, 33), 5) = "ERROR" Then
Sheets("ImportSheet").Select
Rows(x & ":" & x).Select
Application.CutCopyMode = False
Selection.Cut
Sheets("ERRORS").Select
Rows(lastrowE & ":" & lastrowE).Select
ActiveSheet.Paste
lastrowE = lastrowE + 1
End If
Next x
Bookmarks