LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Sheet1 object not Worksheets("Sheet1")

I create a new workbook containing three worksheets, look in the VBE
and see four objects: ThisWorkbook, Sheet1, Sheet2 and Sheet3. Does
anyone know what these 'sheet' objects are? Typename(Sheet1) tells me
it's a Worksheet object but there seems to be more to it than that.

If I add a public property to the Sheet1 code module I can access it
in code with Sheet1.MyProperty but Worksheets("Sheet1").MyProperty
fails.

Is there a collection object that holds these 'sheet' objects? The
Sheets object sounds promising but appears to be a metacolletion that
includes Worksheet and Chart objects.

I want to define custom properties and methods at the worksheet level
and because these 'Sheet' objects have class modules I though I could
use them. However, without a collection object they may be of no use
to me after all. I could define my own classes that include a
Worksheet property and create an instance for each of my 30 worksheets
but it seems to be 're-inventing the wheel' a bit given these Sheet
object.

Can anyone shed any light on what these objects actually are?

Many thanks.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sheets("Sheet1").Cells.ClearContents Seeker Excel Discussion (Misc queries) 2 October 1st 09 12:00 PM
Active sheet instead of a "sheet1" for Macro Pantera Excel Worksheet Functions 7 December 31st 08 07:47 PM
how do i convert this to a formula +"sheet1!J"&(sheet2!A30)-1 joel Excel Worksheet Functions 3 December 5th 07 01:48 PM
how do copy "sheet1!A1+1 in sheet2 to sheet 3 and get "sheet2!A1+ Dany Excel Discussion (Misc queries) 5 April 16th 07 03:27 AM
How do I color code the "SHEET1" Tab in Excel? kmtg Excel Worksheet Functions 3 June 14th 06 04:13 PM


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"