Try this...
1) It copies all "x" rows to Sheet2
2) It deletes all "x" rows from Sheet1
Sub tester()
Dim i As Integer
Dim r1 As Long '"x" cell row...
Dim cell As Range
Dim rng As Range
Dim ws As Worksheet
Set rng = Range("A1:A20")
Set ws = Sheets("Sheet2")
ws.Range("A1:Z100").Clear
i = 1
For Each cell In rng
r1 = cell.Row
If cell.Value = "x" Then
ws.Range("B" & i & ":K" & i).Value = Range("B" & r1 & ":K" & r1).Value
i = i + 1
Range(r1 & ":" & r1).Delete
End If
Next cell
Dim r2 As Integer
For k = 1 To 20
r2 = 21 - k
If Cells(r2, 1).Value = "x" Then
Range(r2 & ":" & r2).Delete
End If
Next k
ws.Activate
MsgBox ws.Name & " was updated with all " & Chr(34) & "x" & Chr(34) & " rows" & vbCrLf & _
"Sheet1 removed all " & Chr(34) & "x" & Chr(34) & " rows"
End Sub
Bookmarks