View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Difference between Worksheets. and Sheets. is...?

Hello all,

This question is just to satisfy my curiousity, as I don't (yet) believe it
has a significant impact on my code.

I came across something and I can't seem to find the answer. Everything
I've found mentions 'how' to use the collection, and not 'why' to use it.

If I use Sheets("Sheet1").Select, then the sheet is selected without error.
If I use Worksheets("Sheet1").Select, I get a "Subscript out of range" error
(run-time error 9).

I haven't got the slightest idea why there's a difference. Any ideas?
Appreciate anything you might have (ideas, links, suggestions).

In most of my code, when accessing cell values I use:
Worksheets("Sheet1").Cells(1, 1).Value = "some random string"
This has never been an issue. Never really used ther Sheets

Thanks,
Jay