+ Reply to Thread
Results 1 to 7 of 7

VBA Macro to Rename Sheets to Range Contents unless Cell is Blank

  1. #1
    Valued Forum Contributor unit285's Avatar
    Join Date
    10-29-2015
    Location
    TN
    MS-Off Ver
    Office 365
    Posts
    358

    VBA Macro to Rename Sheets to Range Contents unless Cell is Blank

    Rename Sheets Test.xlsm


    This is a pretty simple problem I think but because of my limited knowledge regarding all things VBA I find myself unable to proceed. The attached sheet should make it easy to see what my problem is. Thanks!

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: VBA Macro to Rename Sheets to Range Contents unless Cell is Blank

    Try:
    Please Login or Register  to view this content.
    Put the macro in a regular module not in a Worksheet module as you had it in your attached file.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Valued Forum Contributor unit285's Avatar
    Join Date
    10-29-2015
    Location
    TN
    MS-Off Ver
    Office 365
    Posts
    358

    Re: VBA Macro to Rename Sheets to Range Contents unless Cell is Blank

    Hello and thanks for replying,
    I need this code to be activated by Command Button. Do I add the code to the button's module?

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA Macro to Rename Sheets to Range Contents unless Cell is Blank

    Please Login or Register  to view this content.
    You can either put the code into the buttons module or put the code in its own module and call it from the button.
    If you are happy with my response please click the * in the lower left of my post.

  5. #5
    Valued Forum Contributor unit285's Avatar
    Join Date
    10-29-2015
    Location
    TN
    MS-Off Ver
    Office 365
    Posts
    358

    Re: VBA Macro to Rename Sheets to Range Contents unless Cell is Blank

    Hello Stnkynts,

    Your code gets me very close to what I need. However, I need for it to skip sheets when a cell in range A4:A14 is skipped, so I have 11 sheets I want to potentially rename, and Range ("A4:A14") is 11 cells, if the A6 & A7 cells are blank, I need for Sheets 5 & 6 to not be renamed, but since A8 is populated again I would need Sheet 7 to be renamed. I hope this makes sense to you. Thanks!

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA Macro to Rename Sheets to Range Contents unless Cell is Blank

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor unit285's Avatar
    Join Date
    10-29-2015
    Location
    TN
    MS-Off Ver
    Office 365
    Posts
    358

    Re: VBA Macro to Rename Sheets to Range Contents unless Cell is Blank

    Quote Originally Posted by stnkynts View Post
    Please Login or Register  to view this content.

    PERFECT! Thankyou so much!

+ 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. Replies: 4
    Last Post: 02-09-2015, 05:20 PM
  2. Can a macro rename Excel files based on a cell's contents?
    By chrisd2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2014, 09:51 AM
  3. [SOLVED] Macro Delete Contents in 23rd corresponding cell if the cell in range is a non-blank cell
    By murtaza.khan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-04-2014, 01:11 AM
  4. Macro to Rename sheets based on cell value
    By boll55 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-19-2013, 02:13 PM
  5. Replies: 0
    Last Post: 07-16-2013, 01:20 PM
  6. macro to copy a range of worksheets based on cell entry and rename specific sheets
    By Lbischoff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2012, 12:13 PM
  7. Copy a range to different sheets depending on first cell contents
    By WaveOfMutilation in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 03-01-2010, 12:58 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