+ Reply to Thread
Results 1 to 3 of 3

VBA Excel 2010 - Changing Multiple Sheet Names

Hybrid View

  1. #1
    Registered User
    Join Date
    12-22-2014
    Location
    Dallas, Texas
    MS-Off Ver
    2010
    Posts
    1

    VBA Excel 2010 - Changing Multiple Sheet Names

    After many attempts to alter a sample i stumbled across, "A1 change all sheet names - sample", and many hours of frustrating research; I cannot seem to find any solution which brings me here in hopes of some help on a VBA macro that will allow me to use the data from a specific cell(D3) on a different sheet (Sheet8) to change the name of the tab at the bottom of the screen. I will then take this formula and implement the remainder of the cells, is this the best way to do it?
    Sheet 8 is my master sheet and will be hidden upon completion of the book. My ultimate goal is to have sheets 1,2,3,4,5,6, and 7 take the data from (in order) Cell D3,E3,F3,G3,H3,I3,J3 of which will then change the name of that sheets 1 - 7 to whatever data is in the cell (given that there are no illegal char's etc). Currently Sheet 1 is named Monday , sheet 2 is named Tuesday , etc.... I have already set up corresponding dates on sheet 8(my master sheet) to look like this " Monday - 5-Jan-15 ".

    Is it possible to do this?

    THANK YOU SO MUCH!!!!

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: VBA Excel 2010 - Changing Multiple Sheet Names

    Please note, this only works as long as the sheets were originally created in order eg Sheet 1 was originally called "Sheet1", Sheet 2 "Sheet2" etc

    Sub renameSheets()
    For xCol = 1 To 7
          newname = Cells(1, xCol + 3).Value
          Worksheets(xCol).Name = newname
    Next xCol
    End Sub
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: VBA Excel 2010 - Changing Multiple Sheet Names

    Actually, scratch that, just read your naming convention


    Sub renameSheets()
    sheetnames="Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday"
    oldnames = split(sheetnames,",")
    For xCol = 1 To 7
          newname = Cells(1, xCol + 3).Value
          Worksheets(oldnames(xCol-1)).Name = newname
    Next xCol
    End Sub
    will work

+ 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. Changing code name of excel 2010 sheet using word 2010 vba
    By samkumar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2013, 08:59 AM
  2. Charting - Changing Multiple Line Weights - Excel 2010
    By PGee in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 12-10-2012, 04:42 PM
  3. Excel 2010: Changing Source data on multiple pivot tables
    By dcoates in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-24-2012, 03:42 PM
  4. excel, changing 2 sheet names by input on one tab?
    By qcdorum in forum Excel General
    Replies: 0
    Last Post: 07-04-2011, 08:38 AM
  5. Changing Sheet Names Based on # Values in Names
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-01-2010, 03:34 PM

Tags for this Thread

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