Hi i have the following code to copy rows based on a cell reference
However i cant seem to limit this range. i.e i need it to copy B:E if the row meets the pending criteria
How do i make my code relative with regards to this.
Furthermore, i get an error when pasting - cant seem to find the reason for this.
Than you in advance!!
Sub CopyDataFromSheet()
Worksheets("input").Activate
x = 8
Do While Cells(x, 2) <> " "
If Cells(x, 2) = "Pending" Then
Worksheets("input").Rows(x).Copy
Worksheets("Output").Activate
RowCount = Worksheets("Output").Range("X" & Rows.Count).End(xlUp).Row + 1
Worksheets("Output").Range("X" & RowCount).PasteSpecial xlValues
Application.CutCopyMode = 0
End If
Worksheets("Input").Activate
x = x + 1
Loop
End Sub
Bookmarks