Thread: Set worksheet.
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kevin Burton Kevin Burton is offline
external usenet poster
 
Posts: 19
Default Set worksheet.

I have tried everything and the following statement always gives me an error:

Dim wks As Worksheet

Set wks = Sheets("Columns")

I have an .xls file that has some tabs in it for each "sheet". It turns out
that Sheet3 is named by the tab "Columns". I was expecting to be able to
access this sheet starting with the above statement. But the statement always
throws an error


Runtime error '1004':
Method 'Sheets' of object '_Global' failed

Why is it failing? How do I find out? Is this the correct syntax?

Thank you.

Kevin