+ Reply to Thread
Results 1 to 5 of 5

change sheet codename

  1. #1
    Gary Keramidas
    Guest

    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




  2. #2
    Dave Peterson
    Guest

    Re: 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

  3. #3
    Bob Phillips
    Guest

    Re: 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
    news:OfxG4O%[email protected]...
    > 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
    >
    >
    >




  4. #4
    Gary Keramidas
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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




  5. #5
    Gary Keramidas
    Guest

    Re: change sheet codename

    thanks bob, i'll give it a try

    --


    Gary


    "Bob Phillips" <[email protected]> wrote in message
    news:uKcNAX%[email protected]...
    > 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
    > news:OfxG4O%[email protected]...
    >> 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
    >>
    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1