+ Reply to Thread
Results 1 to 21 of 21

Naming tabs

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Naming tabs

    I am building a workbook with each worksheet being the Sunday of the year. I have made the sheet and used a formula to pick up each date from a master sheet so the user just need to change one date to update all 52 sheets. Is there an easy way to rename each tab without retyping each tab? It would be great if the tab was the same as A1 on each sheet. For example, sheet 1 is Jan 6 2013, sheet 2 is Jan 13 2013, is there a way to do so the tab will be value of A1, and when the date change, so will the tab?
    PS. I do not know how to use vba

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,539

    Re: Naming tabs

    Untested but something like:

    Please Login or Register  to view this content.

    Press Alt-F11 to open up the VBE. Insert a new module. Copy and paste the code into the new module. Press F5 to run the code.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Naming tabs

    hey TM...is that your new "monk" hair cut in your avitar?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,539

    Re: Naming tabs

    @FDibbins: you like?

  5. #5
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Naming tabs

    Thanks for the reply. However when I ran the program I got the following message:
    Complete error
    Invalid outside procedure
    What did I do wrong??

    ---------- Post added at 10:25 AM ---------- Previous post was at 09:55 AM ----------

    I am new to this forum, but it is really helpful. I reran the program with
    Please Login or Register  to view this content.
    . However, I found that it will work only if I type the actual value in the A1 cell, that is instead of "='Date Calc'!D4" which i used to automatically put the date on each sheet from a sheet where changing the first date changes all the sheets. If my logic is right, should I use another word other than value?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,539

    Re: Naming tabs

    The code works just fine either with a value or a formula. You can't have the A1 cells on all the sheets pointing at 'Date Calc'!D4 as you would be trying to give them all the same name, which isn't allowed.

    You need to press Alt-F11 to open the VBE; Insert (on the ribbon) | Module to create a new module and then paste the code into the new module. Click anywhere inside the subroutine and press F5 to run it. If you press F5 when you're not inside a subroutine, you'll get a list of possible macros to choose from.

    Regards, TMS

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Naming tabs

    @amh,

    I would guess that there was an invalid characters, More then likely a "/". Here try your Renaming Macro with this GoodSheetName function to remove any invalid characters.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Naming tabs

    Thanks again, but the new suggestions are above my help, sorry. I do not understand about the stings, routines, etc. SORRY.

    You are correct, but each A1 points to a different cell. A1 on each sheet points to a different cell on my sheet named Date Calc. The first sheet points to D2, the second sheet to D3, and so forth. I did this so the user would only have to change the first date on the Date Calc to update all of the sheets. When I look at the date in the cell it shows the function. When I actuall type in the date (remving the function so the cell actual is text), it runs perfectly! Can I tell it to use the text and not the formula.
    Am I making sense?

    Thanks for all of the help from everyone. Glad I found this forum!!!
    Last edited by Amh; 08-04-2012 at 12:07 PM. Reason: to give more information

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,539

    Re: Naming tabs

    If you have a date in standard dd/mm/yyyy format, the slashes will be rejected. Try formatting the dates without slashes ... hyphens, underscores or spaces will be fine.

    Regards, TMS

  10. #10
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Naming tabs

    Tried formatting the cells as follows

    dddd mmmm dd yyyy

    with just spaces, but how do I input my data in the cell? the only way it lets me enter a date is 01/6/2013 and I get Sunday January 06 2013. What am I doing wrong.

    I DEEPLY APPRECIATE THIS HELP!!!
    Last edited by Amh; 08-04-2012 at 01:18 PM.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,539

    Re: Naming tabs

    The macro has a name ... addsheetnames.

  12. #12
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Naming tabs

    TMS,
    Thanks for all the help, I have not used excel since I retired and am very rusty. Would you be kind enough to continue to help once more? What is wrong with my date formatting and entry. Once that is corrected, it seems the macro should run. THANKS FOR THE HELP AGAIN!

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,539

    Re: Naming tabs

    Sure. Please post a sample workbook. I'd like to see the sheets and the Date Calc sheet.

    Regards, TMS

    ---------- Post added at 07:06 PM ---------- Previous post was at 06:55 PM ----------

    In the meantime, maybe:

    Please Login or Register  to view this content.

    Pick one: no separator, space, hyphen/minus, or underscore. Note that underscore is similar to space option but drops leading zeros.


    Regards, TMS

  14. #14
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Naming tabs

    Will attack workbook this evening (not at home near computer). Deeply appreciate this help. Trying to make it user friendly. Again, THANKS.

  15. #15
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Naming tabs

    Attached is the workbook in rough form. I will be redoing forumals, esp ytd page. Will want to use same format for consecutive years.
    Attached Files Attached Files

  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,539

    Re: Naming tabs

    I'll have a look tomorrow.

    Regards, TMS

  17. #17
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Naming tabs

    Thank TM. Did you get the worksheet? Have you had the opportunity to view it.

  18. #18
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Naming tabs

    TM, did you ever look at the workbook?

  19. #19
    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: Naming tabs

    Hi Amh
    This code is in the attached and appears to do as you require. Run the code from the Button on Sheet Date Calc.
    TM was right on target.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    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.

  20. #20
    Registered User
    Join Date
    08-03-2012
    Location
    Bossier City, LA USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Naming tabs

    Thanks, will try later in week and will let you know if it works.

  21. #21
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Naming tabs

    Isn't it simply like this?
    Attached Files Attached Files

+ 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