I have some code and one of the subs contains this line:
It works flawlessly.
However I now want to run this code on a different sheet, namely one called "Invoice". So I changed the code too:
However now when I run it, I get a runtime 424 error, "Object Required".
If I change it to:
again, it works fine.
Can anyone tell me what's going on, and why sometimes you need to use "Worksheets("<name>")" format and sometimes not?
Thanks!
Also posted here: http://www.ozgrid.com/forum/showthread.php?t=197330&p=759134#post759134
Code:
Do Until Sheet1.Range("A" & Row).Value = vbNullString
It works flawlessly.
However I now want to run this code on a different sheet, namely one called "Invoice". So I changed the code too:
Code:
Do Until Invoice.Range("A" & Row).Value = vbNullString
However now when I run it, I get a runtime 424 error, "Object Required".
If I change it to:
Code:
Do Until Worksheets("Invoice").Range("A" & Row).Value = vbNullString
again, it works fine.
Can anyone tell me what's going on, and why sometimes you need to use "Worksheets("<name>")" format and sometimes not?
Thanks!
Also posted here: http://www.ozgrid.com/forum/showthread.php?t=197330&p=759134#post759134
Last edited: