+ Reply to Thread
Results 1 to 3 of 3

cannot updates sheet name with .CodeName

  1. #1
    Forum Contributor
    Join Date
    02-16-2012
    Location
    London, England
    MS-Off Ver
    Excel mac 2011
    Posts
    238

    cannot updates sheet name with .CodeName

    Hi there,

    Can anyone correct my syntax here please, I am creating a macro that creates a new sheet and names it based on a cell value. I can get it to rename the tab name with this code, but I can't seem to get it to work to rename the sheet object name.

    Please Login or Register  to view this content.
    How it .CodeName supposed to be used.

    Kind regards
    Rob

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: cannot updates sheet name with .CodeName

    Worksheet CodeNames are read only. They're defined by Excel when the sheet is created and cannot be changed.

    EDIT: Apparently there is a "trick" to change the CodeName, but I haven't tried it.
    Change the Sheet’s CodeName in Excel using VBA
    Last edited by AlphaFrog; 06-29-2015 at 10:55 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: cannot updates sheet name with .CodeName

    Can you provide a non-VBA example of what a sheet name is originally, what the cell value you find might be, and what the desired new sheetname would be?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sheet Codename
    By Ravana in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2015, 12:34 PM
  2. Sheet VBA codename in formula
    By BLACKV03 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-31-2013, 10:25 AM
  3. [SOLVED] Selecting sheet by codename in a multi sheet code
    By jshaw82 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-18-2013, 10:46 AM
  4. trying to use sheet CodeName to list all sheet names in a workbook
    By neowok in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2012, 12:06 PM
  5. Get sheet (CodeName) not .Name
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-14-2010, 01:54 PM

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