I wrote code for a "Worksheet_Change" event and everything works as intended in the workbook it was created in.
I then copied the code to the workbook and the worksheet I wanted to use it on and it throws the "runtime error 91" at this line:
OppRow = Range(Cells(6, Tcol - 4), Cells(37, Tcol - 4)).Find(OPP).Row
The variable "OppRow" and "Tcol" are declared as Long. The variable "Tcol" is given a value (a number) and the variable "OPP" is given a 4-character string. This happens before the problematic line.
This problematic line works in the testing workbook but not the workbook it was copied to. This is the only line giving me trouble. Any help will be appreciated.
Cheers
UPDATE - Jan. 3/26 - SOLVED
All it took was modifying the "Find" portion from:
Find(OPP).Row
to this:
Find(OPP, LookIn:=xlValues, LookAt:=xlWhole).Row
Now it works as intended. But I can't explain why the testing workbook didn't need this tweak.
Cheers :-)
