View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Clayman Clayman is offline
external usenet poster
 
Posts: 95
Default Worksheet vs. Worksheets

So, is it possible to access a single worksheet via Worksheet? I've resigned
myself to always using Worksheets() and defining the sheet I need in the
collection (I guess).

There really wouldn't be a need to address something like
Workbook.Worksheet.Range(), would there? Since the workbook and worksheet
need to be defined for this context, you would need to use Workbooks and
Worksheets, right?
--
Adios,
Clay Harryman


"Chip Pearson" wrote:

A Worksheet is a single sheet (tab). Worksheets is a collection of all
worksheet objects in a workbook. Generally speaking, if a object name is
plural (e.g., "Worksheets", "Workbooks", "Hyperlinks"), it is a collection
of zero or more objects of the type having the singular form of the word
("Worksheet", "Workbook", "Hyperlink"). The major exception to this rule is
that "Cells" is not composed of an object named "Cell".

Just as aside, there are two collections for accessing sheets in a workbook.
"Sheets" contains all types of sheets: Worksheet, Chart, Module, etc).
"Worksheets" contains only worksheets, not charts or other types of sheets.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"Clayman" wrote in message
...
What's the difference? When do I use Worksheet? When do I use Worksheets?

The reason I'm asking is that I'm trying to find the value in cell A1 of
the
first sheet of a workbook. This sheet may appear by different names. I've
successfully called this sheet before using
ActiveWorkbook.Worksheets("Sheet1").Range("A1").va lue. This time, I'm
getting
a "Subscript out of Range" error.

Yeah - I wanna be a Geico Caveman...
--
Adios,
Clay Harryman