I'm asking VBA to find a string, then an ending string, and copy all the rows inbetween to paste into another sheet. However when I run the code it can't find the string. I've tested the code in a separate file using the same two strings as a start and ending point and it works just fine.
After looking online I see that the cell format could be causing this, but I don't see how to change it or even if that is the cause in this case. Any help is appreciated
Dim findrow As Long, findrow2 As Long
On Error GoTo errhandler
findrow = Range("A:A").Find("0667 John Smith", Range("A1")).Row
findrow2 = Range("A:A").Find("TTl Hrs For Employee", Range("A" & findrow)).Row
Range("A" & findrow & ":A" & findrow2).Select
Selection.Copy
Sheets("Sheet2").Select
Range("C12").Select
ActiveSheet.Paste
errhandler:
MsgBox "No Cells containing specified text found"
If I type the exact same thing in a new document the code finds it no problem. But in the original I get an code 91 error at the first "findrow" line.