+ Reply to Thread
Results 1 to 11 of 11

Auto Name Worksheet while referencing diff worksheet

  1. #1
    Forum Contributor
    Join Date
    05-23-2007
    Posts
    126

    Auto Name Worksheet while referencing diff worksheet

    I've found code to allow for auto-naming of a worksheet, but seems to only work while referencing cell contents on same worksheet.

    What I'd like to do is auto-name worksheet "A" by referencing a cell on worksheet "B"....

    Any ideas?

    Thanks very much in advance for any direction!

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Auto Name Worksheet while referencing diff worksheet

    Hi,
    Something like this :

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-23-2007
    Posts
    126

    Re: Auto Name Worksheet while referencing diff worksheet

    Thanks GC, but sheet "A" is unknown and would need to be generated automatically. Sheet "B" would be known and unchanging.

    Here's what I've had, but again, it references cell on the same worksheet. Thanks!

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Auto Name Worksheet while referencing diff worksheet

    I'm not sure I understand what you want to do...
    Can you post a sample file ?
    From what I understand, when cell F1 is changed on your sheet, you rename all sheets with the value of their cell F1 ??

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Auto Name Worksheet while referencing diff worksheet

    Sheet 'A' is not unknown, if it's just been created then it's ActiveSheet, or you could have set a reference to it when you created it.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    You can even name it when you create it.

    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  6. #6
    Forum Contributor
    Join Date
    05-23-2007
    Posts
    126

    Re: Auto Name Worksheet while referencing diff worksheet

    Norie... you're right! It's not unknown... duh... because the known name will be changed. Will try this and report back.

  7. #7
    Forum Contributor
    Join Date
    05-23-2007
    Posts
    126

    Re: Auto Name Worksheet while referencing diff worksheet

    Well... I just can't get it... I'm attaching the file, and in a nutshell this is my goal. First, the worksheets will already exist and will need to be renamed.

    Using the contents of the SUMMARY tab, cells C4 through D4, I need to rename the 9 worksheets. If I can figure this out will have other applications as well, since changing 9 tabs isn't too bad... Thanks in advance if you have time to review and offer suggestions!
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Auto Name Worksheet while referencing diff worksheet

    Hi,
    Maybe something like this :

    Note that in your file, you have 9 columns and 7 sheets to rename...

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    05-23-2007
    Posts
    126

    Re: Auto Name Worksheet while referencing diff worksheet

    GC, sorry, but should I be swapping out a placeholder with an actual name/location? I've tried it and I'm getting a runtime error '1004' related to not being able to rename a sheet to the same name as another sheet? I created a module for the code and ran as macro...

    Thanks!

  10. #10
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Auto Name Worksheet while referencing diff worksheet

    You can't have 2 worksheets with the same name, thats correct.
    In the file you sent, that was not the case...
    What is not clear is how the tabs are named BEFORE you run the macro (and how many there are...)

  11. #11
    Forum Contributor
    Join Date
    05-23-2007
    Posts
    126

    Re: Auto Name Worksheet while referencing diff worksheet

    Wanted to update... I went the lazy route, and just named my tabs 1-12. It's not elegant, but it works.

    I do appreciate the help!

+ 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. Macro to select worksheet based on cell value and then return data to diff worksheet
    By clnossok in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2013, 07:48 PM
  2. Replies: 1
    Last Post: 04-19-2013, 07:49 AM
  3. button to copy worksheet with formulas referencing previous worksheet
    By Alexelius in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-28-2011, 09:40 AM
  4. Replies: 3
    Last Post: 01-21-2011, 08:07 AM
  5. CountIF() in Worksheet B while referencing cells in Worksheet A
    By jfj3rd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-14-2006, 02:40 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