View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Recognizating worksheet name

John,

Maybe stating the obvious, but worksheet 1 hasn't been renamed by any
chance?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"John H" wrote in message
...
I have one Workbook that has a unique problem. When I attempt to access

it from code in a module with the name of the sheet or "Sheet1", I get a
<subscript out of range error. I can access when I use the number
(provided it is the first sheet). All the other worksheets in the workbook
can be accessed by name.

The code is:

With Worksheets("Sheet1") ' return <subscript out of range error

With Worksheets(1) ' works

NOTE: This same worksheet will not run a function attached to that sheet

or from a module.

Is there some switch that needs to be changed