Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sheets vs. Worksheets

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
This isnt really a question on how to carry out a procedure. Being that I'm still a relative newbie to VBA, I keep noticing some programmers use worksheets and sheets interchangeably, such as

Sheets(1).select or
worksheets("My sheet").activate.... etc, etc

what exactly is the difference between the 2 collections, when would you use one or the other. I always referece sheets in my code, and so I dont want to use the wrong object. Thanks!!
 
A sheet can be worksheet, chartsheet, old style dialogsheet or macro sheet. So sheets is a collection of different objects, whereas Worksheets is a collection of uniform objects (just worksheets).
In opposite to Worksheet, there is no 'sheet' object.

combo
 
So basically i can use sheets for all the objects you just mentioned so i can put sheet(sheetobject) so thats how it can be used interchangeably as i put before. but for worksheets you can only put worksheets(worksheetobject)? that probably explains it since i only deal with worksheet objects and nothing else, thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top