Copy/paste rows to new sheet based on cell value

  • Thread starter Thread starter Taylor
  • Start date Start date
T

Taylor

I have a large spreadsheet in which one column returns "check status",
"visit", or "Send Letter 2" based on an IF/THEN formula. Is there a way to
automatically select those rows containing "check status", "visit", and "Send
Letter 2", copy the row and paste it onto a new sheet? Do I need a macro for
this?
 
This assumes your values are in column A:

Sub CopyRows()
lrow = Sheets(1).Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To lrow
dest = Sheets(2).Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, 1).Value = "check status" Or _
Cells(i, 1).Value = "visit" Or _
Cells(i, 1).Value = "Send Letter 2" Then
Rows(i).Copy Sheets(2).Rows(dest + 1)
End If
Next i
End Sub
 
Back
Top