#1   Report Post  
solotoo
 
Posts: n/a
Default Worksheet Name


What is the difference between *Name* and *(Name) * in the Worksheet
properties.
I can define, change and goto sheets with the *name* option but cannot
seem to do the same with the *(Name) * property.
-eg. - In a new spreadsheet when I look at the Excel Objects page in
the VBA screen the three default pages are listed as Sheet(Sheet1),
Sheet2(Sheet2), Sheet3(Sheet3).
If I rename a sheet on the sheet tabs, then it is just the name in
brackets which is changed. How can I change the other name by code - I
can type it in the properties.

Thanks.


--
solotoo
------------------------------------------------------------------------
solotoo's Profile: http://www.excelforum.com/member.php...o&userid=18519
View this thread: http://www.excelforum.com/showthread...hreadid=376746

  #2   Report Post  
Vasant Nanavati
 
Posts: n/a
Default

This is the CodeName property and cannot be changed through code. It is
often used to refer to worksheets so that your macro doesn't break if the
user changes the tab names.

--

Vasant

"solotoo" wrote in
message ...

What is the difference between *Name* and *(Name) * in the Worksheet
properties.
I can define, change and goto sheets with the *name* option but cannot
seem to do the same with the *(Name) * property.
-eg. - In a new spreadsheet when I look at the Excel Objects page in
the VBA screen the three default pages are listed as Sheet(Sheet1),
Sheet2(Sheet2), Sheet3(Sheet3).
If I rename a sheet on the sheet tabs, then it is just the name in
brackets which is changed. How can I change the other name by code - I
can type it in the properties.

Thanks.


--
solotoo
------------------------------------------------------------------------
solotoo's Profile:

http://www.excelforum.com/member.php...o&userid=18519
View this thread: http://www.excelforum.com/showthread...hreadid=376746



  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

hmmmm.

ThisWorkbook.VBProject.VBComponents("Sheet1").Prop erties("_CodeName").Value _
= "NewCodeName"

(From a Chip Pearson post (a longggggg time ago).)

Vasant Nanavati wrote:

This is the CodeName property and cannot be changed through code. It is
often used to refer to worksheets so that your macro doesn't break if the
user changes the tab names.

--

Vasant

"solotoo" wrote in
message ...

What is the difference between *Name* and *(Name) * in the Worksheet
properties.
I can define, change and goto sheets with the *name* option but cannot
seem to do the same with the *(Name) * property.
-eg. - In a new spreadsheet when I look at the Excel Objects page in
the VBA screen the three default pages are listed as Sheet(Sheet1),
Sheet2(Sheet2), Sheet3(Sheet3).
If I rename a sheet on the sheet tabs, then it is just the name in
brackets which is changed. How can I change the other name by code - I
can type it in the properties.

Thanks.


--
solotoo
------------------------------------------------------------------------
solotoo's Profile:

http://www.excelforum.com/member.php...o&userid=18519
View this thread: http://www.excelforum.com/showthread...hreadid=376746


--

Dave Peterson
  #4   Report Post  
Vasant Nanavati
 
Posts: n/a
Default

You're right <g ... I forgot about doing it by programming the VBE.

Regards,

Vasant


"Dave Peterson" wrote in message
...
hmmmm.


ThisWorkbook.VBProject.VBComponents("Sheet1").Prop erties("_CodeName").Value
_
= "NewCodeName"

(From a Chip Pearson post (a longggggg time ago).)

Vasant Nanavati wrote:

This is the CodeName property and cannot be changed through code. It is
often used to refer to worksheets so that your macro doesn't break if

the
user changes the tab names.

--

Vasant

"solotoo" wrote

in
message ...

What is the difference between *Name* and *(Name) * in the Worksheet
properties.
I can define, change and goto sheets with the *name* option but cannot
seem to do the same with the *(Name) * property.
-eg. - In a new spreadsheet when I look at the Excel Objects page in
the VBA screen the three default pages are listed as Sheet(Sheet1),
Sheet2(Sheet2), Sheet3(Sheet3).
If I rename a sheet on the sheet tabs, then it is just the name in
brackets which is changed. How can I change the other name by code - I
can type it in the properties.

Thanks.


--
solotoo


------------------------------------------------------------------------
solotoo's Profile:

http://www.excelforum.com/member.php...o&userid=18519
View this thread:

http://www.excelforum.com/showthread...hreadid=376746


--

Dave Peterson



  #5   Report Post  
Chip Pearson
 
Posts: n/a
Default

You can also do it by accessing the Name property of the
VBComponent.

ThisWorkbook.VBProject.VBComponents("Sheet1").Name =
"NewCodeName"



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Dave Peterson" wrote in message
...
hmmmm.

ThisWorkbook.VBProject.VBComponents("Sheet1").Prop erties("_CodeName").Value
_
= "NewCodeName"

(From a Chip Pearson post (a longggggg time ago).)

Vasant Nanavati wrote:

This is the CodeName property and cannot be changed through
code. It is
often used to refer to worksheets so that your macro doesn't
break if the
user changes the tab names.

--

Vasant

"solotoo"
wrote
in
message
...

What is the difference between *Name* and *(Name) * in the
Worksheet
properties.
I can define, change and goto sheets with the *name* option
but cannot
seem to do the same with the *(Name) * property.
-eg. - In a new spreadsheet when I look at the Excel Objects
page in
the VBA screen the three default pages are listed as
Sheet(Sheet1),
Sheet2(Sheet2), Sheet3(Sheet3).
If I rename a sheet on the sheet tabs, then it is just the
name in
brackets which is changed. How can I change the other name
by code - I
can type it in the properties.

Thanks.


--
solotoo
------------------------------------------------------------------------
solotoo's Profile:

http://www.excelforum.com/member.php...o&userid=18519
View this thread:
http://www.excelforum.com/showthread...hreadid=376746


--

Dave Peterson





  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default

One thing I liked about your post from a longggggg time ago was that I didn't
really need to know the name of the worksheet or the codename of the worksheet
to start.

Sub aa()
Dim wks As Worksheet
Set wks = ActiveSheet
ThisWorkbook.VBProject.VBComponents(wks.Name).Prop erties("_CodeName").Value _
= "NewCodeName2"
End Sub



Chip Pearson wrote:

You can also do it by accessing the Name property of the
VBComponent.

ThisWorkbook.VBProject.VBComponents("Sheet1").Name =
"NewCodeName"

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Dave Peterson" wrote in message
...
hmmmm.

ThisWorkbook.VBProject.VBComponents("Sheet1").Prop erties("_CodeName").Value
_
= "NewCodeName"

(From a Chip Pearson post (a longggggg time ago).)

Vasant Nanavati wrote:

This is the CodeName property and cannot be changed through
code. It is
often used to refer to worksheets so that your macro doesn't
break if the
user changes the tab names.

--

Vasant

"solotoo"
wrote
in
message
...

What is the difference between *Name* and *(Name) * in the
Worksheet
properties.
I can define, change and goto sheets with the *name* option
but cannot
seem to do the same with the *(Name) * property.
-eg. - In a new spreadsheet when I look at the Excel Objects
page in
the VBA screen the three default pages are listed as
Sheet(Sheet1),
Sheet2(Sheet2), Sheet3(Sheet3).
If I rename a sheet on the sheet tabs, then it is just the
name in
brackets which is changed. How can I change the other name
by code - I
can type it in the properties.

Thanks.


--
solotoo
------------------------------------------------------------------------
solotoo's Profile:
http://www.excelforum.com/member.php...o&userid=18519
View this thread:
http://www.excelforum.com/showthread...hreadid=376746


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
solotoo
 
Posts: n/a
Default


That's great everyone, thankyou very much!!!!


--
solotoo
------------------------------------------------------------------------
solotoo's Profile: http://www.excelforum.com/member.php...o&userid=18519
View this thread: http://www.excelforum.com/showthread...hreadid=376746

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM
Indirect reference from one worksheet to another Bill Sturdevant Excel Worksheet Functions 2 December 17th 04 01:23 PM
Reference Data in Moved Worksheet tommcbrny Setting up and Configuration of Excel 1 December 1st 04 06:49 PM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"