View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken McLennan[_3_] Ken McLennan[_3_] is offline
external usenet poster
 
Posts: 90
Default What is the real name?

G'day there One & All,

I just have a quick question to try to clarify how something
works. My WorkBook contains 8 WorkSheets. Oddly enough, the Project
Browser shows a tree of 8 WorkSheets named: Sheet1(Main); Sheet2
(Roster); Sheet3(Staff); etc.

The Properties Window indicates that each sheet has a "(Name)",
eg. "Sheet6", and a "Name", eg. "Equity". I know that they don't refer
to the same thing, but what is the difference between the 2?

I have previously used the "(Name)" to refer to each sheet by
changing its value. Eg. Sheet1(Main) became "mSht". This allowed me to
use such constructs as "mSht.Range("Groups").clearcontents". However in
some circumstances, which I never understood & so can't really explain,
this didn't work & I had to also "Dim mSht as WorkSheet" and then "Set
mSht = WorkSheets("Main")". Why is this?

Can someone either explain, or point me to a web based description
of what & why? My current code had a bit of difficulty referring to one
of the sheets so I changed them all back to the "Sheet1(Main)" format
and Dimmed and Set all over the place to compensate. I can't see what
the problem was and I found it easier to refer to sheets as "mSht".

Is it that the (Name) represents the WorkSheet object for the
particular sheet, while Name is just a property? That's the only
scenario I could think of, but I still don't quite grasp the possible
ramifications.

Thanks for listening,
--
Ken McLennan
Qld, Australia