View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default What is the difference beyween "Sheets" and WorkSheets" in subrout

The sheets collection includes all sheets (worksheets, charts, macrosheets,
dialogsheets).

the Worksheets collection only includes worksheets

As for referencing a worksheet, there should be no difference

Dim sh as Worksheet
set sh = Worksheets("Sheet1")
set sh = Sheets("Sheet1")

should be no different.

This isn't true if you have other kinds of sheets in the workbook (besides
worksheets) and you are trying to use an index number into the collection -
but you don't show that in your example.


--
Regards,
Tom Ogilvy


"Jack_Feeman" wrote in message
...
I have modules that refer to worksheets sometimes as Sheets("sheetname")

and
sometimes as Worksheets("sheetname").

Even when they are used in the same routine, I get no error message and

the
routine works (at least on my machine; the one it was composed on. Others
reporting that it is erroring out for them.)

Where does Excel do its versioning? I thought since some of the errors
indicate it routine is calling the macro from an old version of the

document
that it may be a versioning issue (although none of my modules shows a

past
version in the code).

Thanks
Jack