ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Whats the difference (https://www.excelbanter.com/excel-programming/326063-whats-difference.html)

pete

Whats the difference
 
Whats the difference between using

Sheets

or

Worksheets

Example


Sheets("Sheet1").Range("D2").Copy

and


WorkSheets("Sheets1").Range("D2").Copy

They both seem to do the same thing. So is there any difference in using
them?



Bob Phillips[_6_]

Whats the difference
 
Worksheets are a specific type of sheet, that are used for capturing and
manipulating data using functions and formulas. Sheets includes Worksheets,
Chart Sheets, Dialog sheets, macro sheets, etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pete" wrote in message
...
Whats the difference between using

Sheets

or

Worksheets

Example


Sheets("Sheet1").Range("D2").Copy

and


WorkSheets("Sheets1").Range("D2").Copy

They both seem to do the same thing. So is there any difference in using
them?





david mcritchie

Whats the difference
 
Hi Pete,
If sheets1 were sheet1 instead there would be no difference
to you.

The Sheets collection includes Worksheets, and Charts. Prior to Excel 97 macros were in Macro sheets.

What you would have to watch out for is cycling through on a count
of items in a collection, you have be consistent with what you are
working with.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Pete" wrote in message ...
Whats the difference between using

Sheets

or

Worksheets

Example


Sheets("Sheet1").Range("D2").Copy

and


WorkSheets("Sheets1").Range("D2").Copy

They both seem to do the same thing. So is there any difference in using
them?







All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com