+ Reply to Thread
Results 1 to 8 of 8

Get sheet (CodeName) not .Name

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Get sheet (CodeName) not .Name

    I can get a worksheet name and index, how do I get the worksheet (Name)?
    Example:
    I delete sheet1, copy sheet3 before sheet2, rename to sheet1 but the VBA name is Sheet4. The index number will be 1 but it is not Sheet1 in the VBA Project Explorer.
    Last edited by Rick_Stanich; 01-14-2010 at 01:39 PM. Reason: Edited title
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Get sheet (Name) not .Name

    You need the CodeName rather than the Name property.
    Remember what the dormouse said
    Feed your head

  3. #3
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Get sheet (Name) not .Name

    Sounds like you want .CodeName

  4. #4
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Get sheet (Name) not .Name

    Thanks, could not find out what I needed from the help files.

    Darn, you cant change the codename progmatically?

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Get sheet (Name) not .Name

    Hi Rick
    Try this link http://www.cpearson.com/Excel/codemods.htm
    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Get sheet (Name) not .Name

    Thanks, that did the trick
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Get sheet (Name) not .Name

    man. you learn something everyday. Thanx, John.

  8. #8
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Get sheet (CodeName) not .Name


+ 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