Hello Experts!
How would you remove blank lines (cf. picture)? Please Help!
Public Sub CopyRows()
Sheets("EXTRACTION").Select
' Find the last row of data
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
' Loop through each row
For x = 2 To FinalRow
' Decide if to copy based on column G (A=1;E=5...)
ThisValue = Cells(x, 7).Value
If ThisValue = "Completed" Then
Cells(x, 1).Resize(1, 33).Cut
Sheets("Completed").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("EXTRACTION").Select
ElseIf ThisValue = "Rejected" Then
Cells(x, 1).Resize(1, 33).Cut
Sheets("Rejected").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("EXTRACTION").Select
End If
Next x
End Sub
How would you remove blank lines (cf. picture)? Please Help!
Public Sub CopyRows()
Sheets("EXTRACTION").Select
' Find the last row of data
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
' Loop through each row
For x = 2 To FinalRow
' Decide if to copy based on column G (A=1;E=5...)
ThisValue = Cells(x, 7).Value
If ThisValue = "Completed" Then
Cells(x, 1).Resize(1, 33).Cut
Sheets("Completed").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("EXTRACTION").Select
ElseIf ThisValue = "Rejected" Then
Cells(x, 1).Resize(1, 33).Cut
Sheets("Rejected").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("EXTRACTION").Select
End If
Next x
End Sub