N
Novice Lee
I was looking at another question and the folowing was suggested
Sub stance()
Dim MyRange
Dim copyrange As Range
Lastrow = Cells(Cells.Rows.Count, "D").End(xlUp).Row
Set MyRange = Range("D1" & Lastrow)
For Each C In MyRange
If UCase(C.Value) = "R" Then
If copyrange Is Nothing Then
Set copyrange = C.EntireRow
Else
Set copyrange = Union(copyrange, C.EntireRow)
End If
End If
Next
If Not copyrange Is Nothing Then
copyrange.Copy
Sheets("Resigned").Range("A1").PasteSpecial
End If
End Sub
How can I change it to copy the row that has anything in column A with
44OP- in. The spreadsheet has two blank lines in-between each row of data.
Thanks for any help
Sub stance()
Dim MyRange
Dim copyrange As Range
Lastrow = Cells(Cells.Rows.Count, "D").End(xlUp).Row
Set MyRange = Range("D1" & Lastrow)
For Each C In MyRange
If UCase(C.Value) = "R" Then
If copyrange Is Nothing Then
Set copyrange = C.EntireRow
Else
Set copyrange = Union(copyrange, C.EntireRow)
End If
End If
Next
If Not copyrange Is Nothing Then
copyrange.Copy
Sheets("Resigned").Range("A1").PasteSpecial
End If
End Sub
How can I change it to copy the row that has anything in column A with
44OP- in. The spreadsheet has two blank lines in-between each row of data.
Thanks for any help