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
|