View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
N L N L is offline
external usenet poster
 
Posts: 7
Default Error 1004 on VBA operation

On Mar 20, 8:26*pm, "IanKR" wrote:

Doesn't Excel VBA work in mysterious ways!


It sure does. It seemed to be that directly, explicitly referencing
the sheet I wanted to specify by putting it in quotes:
Set ActualsActualsRange = ActiveWorkbook.Worksheets("Actuals-
Sheet").Range(Cells(5, 12), Cells(5, 500))
...it would have been okay.
I think you're right that Excel is ignoring my direct reference to
Worksheets("Actuals-Sheet"), because this does work if I'm already IN
Actuals-Sheet. The trick is learning through experience where VBA does
what you think it should do, and where it follows its own rules.

I've since gone about the entire problem a different way, and I'm
running all of the code in an entirely separate workbook.

Thanks again.
N L