Hello all,
I've been trying to figure this out for a while now (I hope it is right in front of my face and I just can't see it).
I have a line of code that works when it is ran in its sub, but throws an error when that sub is called upon.
I get a "Run-time error '1004': Application-defined or object-defined error"
This is the line
nRow and xRow are Longs and upname is a variant
I originally got this error with this line:
and "fixed" it by adding the more defined Sheets("Base").
It worked for a while, but when I called the macro it threw the above error. Any ideas? Thanks in advance!!
I've been trying to figure this out for a while now (I hope it is right in front of my face and I just can't see it).
I have a line of code that works when it is ran in its sub, but throws an error when that sub is called upon.
I get a "Run-time error '1004': Application-defined or object-defined error"
This is the line
Code:
nRow = Sheets("Base").Range(Sheets("Base").Cells(xRow - 5, 9), Sheets("Base").Cells(xRow + 4000, 9)).Find(upname).Row
nRow and xRow are Longs and upname is a variant
I originally got this error with this line:
Code:
nRow = Sheets("Base").Range(Cells(xRow - 5, 9), Cells(xRow + 4000, 9)).Find(upname).Row
and "fixed" it by adding the more defined Sheets("Base").
It worked for a while, but when I called the macro it threw the above error. Any ideas? Thanks in advance!!