When starting the Visual Basic editor three windows pop up: the editor,
a kind of quot;project explorerquot; and a sheet properties.
1) I am curious about this quot;sheet propertiesquot; window appearing with the
editor. What is the purpose in a VBA programming situation?
2) Two of the sheet properties are 'Name' and '(Name)' and both are by
default designated 'Sheet1'. Apart from the fact that you can change
'Name' by clicking the tab of the sheet, what is the difference between
the two properties?
3) I have a workbook where I need an easy reference to each sheet, but
they are all given an explanatory 'Name' that is both long and
complicated and cannot be changed, so I hope to be able to use the
other. Is it possible in formulas or VBA to refer to '(Name)' in stead
of 'Name'?NSV--
nsv
------------------------------------------------------------------------
nsv's Profile: www.excelforum.com/member.php...oamp;userid=26500
View this thread: www.excelforum.com/showthread...hreadid=504380
quot;nsvquot; gt; wrote in message
...
gt;
gt; When starting the Visual Basic editor three windows pop up: the editor,
gt; a kind of quot;project explorerquot; and a sheet properties.
gt;
gt; 1) I am curious about this quot;sheet propertiesquot; window appearing with the
gt; editor. What is the purpose in a VBA programming situation?
You can change the properties there, such as the name, the visible property.
gt; 2) Two of the sheet properties are 'Name' and '(Name)' and both are by
gt; default designated 'Sheet1'. Apart from the fact that you can change
gt; 'Name' by clicking the tab of the sheet, what is the difference between
gt; the two properties?
Name is the value that you see in Excel, and can be changed here. (Name) is
what is called the CodeName and cannot be changed from Excel. Because of
this, worksheets are often addressed in VBA code by the codename, as you
know the user will not change that whereas they might change the Name of the
worksheet.
gt; 3) I have a workbook where I need an easy reference to each sheet, but
gt; they are all given an explanatory 'Name' that is both long and
gt; complicated and cannot be changed, so I hope to be able to use the
gt; other. Is it possible in formulas or VBA to refer to '(Name)' in stead
gt; of 'Name'?
As explained above yes. Instead of
Worksheets(quot;Sheet1quot;).Select
you use
Sheet1.Seelect
It is also good practice to give a meaningful codename to your worksheets,
such as Master, Totals, or whatever. I also precede the codename with 'ws'
as a quickly identifiable handle.
Thanks a lot - all seems logical and it is surely very useful.
NSV--
nsv
------------------------------------------------------------------------
nsv's Profile: www.excelforum.com/member.php...oamp;userid=26500
View this thread: www.excelforum.com/showthread...hreadid=504380
- Jan 24 Wed 2007 20:35
Sheet properties Name and (Name)
close
全站熱搜
留言列表
發表留言