ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   change sheet codename (https://www.excelbanter.com/excel-programming/355117-change-sheet-codename.html)

Gary Keramidas

change sheet codename
 
is there a command to change the codename of a sheet?

tried worksheets("Sheet1").codename = "test"

but i think the codename only retrieves values, it doesn't set them.

--


Gary




Dave Peterson

change sheet codename
 
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"

Gary Keramidas wrote:

is there a command to change the codename of a sheet?

tried worksheets("Sheet1").codename = "test"

but i think the codename only retrieves values, it doesn't set them.

--

Gary


--

Dave Peterson

Bob Phillips[_6_]

change sheet codename
 
With ActiveSheet
.Parent.VBProject.VBComponents(.CodeName) _
.Properties("_CodeName") = "somevalue"
End With



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
is there a command to change the codename of a sheet?

tried worksheets("Sheet1").codename = "test"

but i think the codename only retrieves values, it doesn't set them.

--


Gary






Gary Keramidas

change sheet codename
 
thanks, dave, needed the 2nd example because i was inserting a sheet and have no
idea what name excel is assigning to it. i only have 20 sheets, but probably
because of manipulating things excel was give codenames in the 30's.


--


Gary


"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"

Gary Keramidas wrote:

is there a command to change the codename of a sheet?

tried worksheets("Sheet1").codename = "test"

but i think the codename only retrieves values, it doesn't set them.

--

Gary


--

Dave Peterson




Gary Keramidas

change sheet codename
 
thanks bob, i'll give it a try

--


Gary


"Bob Phillips" wrote in message
...
With ActiveSheet
.Parent.VBProject.VBComponents(.CodeName) _
.Properties("_CodeName") = "somevalue"
End With



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
is there a command to change the codename of a sheet?

tried worksheets("Sheet1").codename = "test"

but i think the codename only retrieves values, it doesn't set them.

--


Gary









All times are GMT +1. The time now is 08:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com