Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Change Sheet Name

Hello

I am trying to Change The worksheet name in a macro (NOT THE TAB NAME) is
this possible

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Change Sheet Name

Hi Skid,

Try something like:

'==========
Sub Test2()

Sheets("Sheet1").Name = "New Sheet"

End Sub
'<<==========

---
Regards,
Norman



"skid" wrote in message
...
Hello

I am trying to Change The worksheet name in a macro (NOT THE TAB NAME) is
this possible

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Change Sheet Name

Hi Skid,

I have belatedly see: "NOT THE TAB NAME", so please ignore my suggestion.

However, what do you mean by changing the sheet's name?

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Skid,

Try something like:

'==========
Sub Test2()

Sheets("Sheet1").Name = "New Sheet"

End Sub
'<<==========

---
Regards,
Norman



"skid" wrote in message
...
Hello

I am trying to Change The worksheet name in a macro (NOT THE TAB NAME) is
this possible

Thanks





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Change Sheet Name

This is changing the wrong name propery. In the Properties pane I need to
change the (Name) property. is this possible in VB.

thanks skid

"Norman Jones" wrote:

Hi Skid,

Try something like:

'==========
Sub Test2()

Sheets("Sheet1").Name = "New Sheet"

End Sub
'<<==========

---
Regards,
Norman



"skid" wrote in message
...
Hello

I am trying to Change The worksheet name in a macro (NOT THE TAB NAME) is
this possible

Thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Change Sheet Name

Hi Skid,

A sheet's codename cannot be altered programmatically at run time; it can,
of course, be changed manually from the VBE properties window.

---
Regards,
Norman



"skid" wrote in message
...
This is changing the wrong name propery. In the Properties pane I need to
change the (Name) property. is this possible in VB.

thanks skid

"Norman Jones" wrote:

Hi Skid,

Try something like:

'==========
Sub Test2()

Sheets("Sheet1").Name = "New Sheet"

End Sub
'<<==========

---
Regards,
Norman



"skid" wrote in message
...
Hello

I am trying to Change The worksheet name in a macro (NOT THE TAB NAME)
is
this possible

Thanks








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Change Sheet Name

I just found it in another post. it's the code Name

Thanks for the help.

"Norman Jones" wrote:

Hi Skid,

I have belatedly see: "NOT THE TAB NAME", so please ignore my suggestion.

However, what do you mean by changing the sheet's name?

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Skid,

Try something like:

'==========
Sub Test2()

Sheets("Sheet1").Name = "New Sheet"

End Sub
'<<==========

---
Regards,
Norman



"skid" wrote in message
...
Hello

I am trying to Change The worksheet name in a macro (NOT THE TAB NAME) is
this possible

Thanks






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Change Sheet Name

Maybe...

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

if you don't know the original codename:

dim wks as worksheet
set wks = activesheet
ThisWorkbook.VBProject.VBComponents(wks.codename). Name = "NewCodeName"





Norman Jones wrote:

Hi Skid,

A sheet's codename cannot be altered programmatically at run time; it can,
of course, be changed manually from the VBE properties window.

---
Regards,
Norman

"skid" wrote in message
...
This is changing the wrong name propery. In the Properties pane I need to
change the (Name) property. is this possible in VB.

thanks skid

"Norman Jones" wrote:

Hi Skid,

Try something like:

'==========
Sub Test2()

Sheets("Sheet1").Name = "New Sheet"

End Sub
'<<==========

---
Regards,
Norman



"skid" wrote in message
...
Hello

I am trying to Change The worksheet name in a macro (NOT THE TAB NAME)
is
this possible

Thanks





--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Change Sheet Name

Hi Dave,

I was overly prepared to accept the accuracy of Microsoft's help:

'-----------------------------
CodeName Property

Returns the code name for the object. Read-only String.

Note The value that you see in the cell to the right of (Name) in the
Properties window is the code name of the selected object. At design time,
you can change the code name of an object by changing this value. You cannot
programmatically change this property at run time.

....
'<<--------------------------------

Thank you for the correction and the information.

---
Regards,
Norman



"Dave Peterson" wrote in message
...
Maybe...

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

if you don't know the original codename:

dim wks as worksheet
set wks = activesheet
ThisWorkbook.VBProject.VBComponents(wks.codename). Name = "NewCodeName"




Norman Jones wrote:

Hi Skid,

A sheet's codename cannot be altered programmatically at run time; it
can,
of course, be changed manually from the VBE properties window.

---
Regards,
Norman



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Change Sheet Name

Thanks Dave This works GREAT!!
have a good Turkey day.

"Dave Peterson" wrote:

Maybe...

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

if you don't know the original codename:

dim wks as worksheet
set wks = activesheet
ThisWorkbook.VBProject.VBComponents(wks.codename). Name = "NewCodeName"





Norman Jones wrote:

Hi Skid,

A sheet's codename cannot be altered programmatically at run time; it can,
of course, be changed manually from the VBE properties window.

---
Regards,
Norman

"skid" wrote in message
...
This is changing the wrong name propery. In the Properties pane I need to
change the (Name) property. is this possible in VB.

thanks skid

"Norman Jones" wrote:

Hi Skid,

Try something like:

'==========
Sub Test2()

Sheets("Sheet1").Name = "New Sheet"

End Sub
'<<==========

---
Regards,
Norman



"skid" wrote in message
...
Hello

I am trying to Change The worksheet name in a macro (NOT THE TAB NAME)
is
this possible

Thanks





--

Dave Peterson

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Change Sheet Name

Yeah, but you can't do:
wks.codename = "newcodename"

(Chip Pearson was my original source, IIRC.)



Norman Jones wrote:

Hi Dave,

I was overly prepared to accept the accuracy of Microsoft's help:

'-----------------------------
CodeName Property

Returns the code name for the object. Read-only String.

Note The value that you see in the cell to the right of (Name) in the
Properties window is the code name of the selected object. At design time,
you can change the code name of an object by changing this value. You cannot
programmatically change this property at run time.

...
'<<--------------------------------

Thank you for the correction and the information.

---
Regards,
Norman

"Dave Peterson" wrote in message
...
Maybe...

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

if you don't know the original codename:

dim wks as worksheet
set wks = activesheet
ThisWorkbook.VBProject.VBComponents(wks.codename). Name = "NewCodeName"




Norman Jones wrote:

Hi Skid,

A sheet's codename cannot be altered programmatically at run time; it
can,
of course, be changed manually from the VBE properties window.

---
Regards,
Norman


--

Dave Peterson
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
how to change formula in shared sheet without loss of change histo DCE Excel Worksheet Functions 1 July 23rd 08 05:09 PM
Change workbook sheet reference using cell A1 to change a vairable Reed Excel Worksheet Functions 4 January 20th 05 07:15 PM
How to record a sheet change showing row column sheet name and date? Simon Lloyd[_584_] Excel Programming 0 October 6th 04 12:57 PM
How to record a sheet change showing row column sheet name and date? Simon Lloyd[_580_] Excel Programming 1 October 6th 04 09:30 AM
How to record a sheet change showing row column sheet name and date? Simon Lloyd[_574_] Excel Programming 1 October 5th 04 11:22 AM


All times are GMT +1. The time now is 11:14 PM.

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

About Us

"It's about Microsoft Excel"