So I basically have a template workbook that the code is stored in. I need it to pull an entire row if Column C in workbook "rawdata" contains specific text, in this case "PRCH - Purchase".
I have never had to do anything like this before, it has always been working in the same workbook. Can someone tell me where I went wrong? It's failing at the 'mp = ...' line every time. There might be other errors in the code too, I just cannot resolve the first one! Any help is appreciated!
mp = Workbooks("rawdata").Sheets("Scorecard").Cells("C", Rows.Count).End(xlUp).Row
mp1 = Workbooks("template").Sheets("PRCH").Cells(Rows.Count, "A").End(xlUp).Row
For r = mp To 2 Step -1
If Workbooks("rawdata").Sheets("Scorecard").Range("C" & r).Value = "PRCH - Purchase" Then
Rows(r).Copy Destination:=Workbooks("template").Sheets("PRCH").Range("A" & mp1 + 1)
mp1 = Workbooks("template").Sheets("PRCH").Cells(Rows.Count, "A").End(xlUp).Row
End If
Next r
Bookmarks