+ Reply to Thread
Results 1 to 7 of 7

automatic replace sheet names based on new cell text (within defined range)

  1. #1
    Registered User
    Join Date
    01-28-2014
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    55

    automatic replace sheet names based on new cell text (within defined range)

    Is it possible to have sheet names automaticaly changed by text in a defined range of cells? Currently I'm changing sheet names manually.
    I attached a file with I show what I need.
    Thanks in advance!
    Rgds, Robert
    Attached Files Attached Files

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: automatic replace sheet names based on new cell text (within defined range)

    Try this.....
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: automatic replace sheet names based on new cell text (within defined range)

    try this attached file
    Attached Files Attached Files
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  4. #4
    Registered User
    Join Date
    01-28-2014
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: automatic replace sheet names based on new cell text (within defined range)

    Hi sktneer, thanks for your help! When executing the macro, nothing happens..(script placed in new module 1) Has the range in column B still to be added in the script?

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: automatic replace sheet names based on new cell text (within defined range)

    The code will change the sheet names as per the cell values in the range B3:B5.
    For detail see the attached sheet. Click the button "Click Here" to run the code.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-28-2014
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: automatic replace sheet names based on new cell text (within defined range)

    Hi Naveed, I get a run time error 1004: Method 'Name' of Object" '_Worksheet' failed
    In sub replace_sheet_name() the yellow arrow directs to:
    .Name = MSht.Range("C" & i).

  7. #7
    Registered User
    Join Date
    01-28-2014
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: automatic replace sheet names based on new cell text (within defined range)

    Hi Naveed, I get a run time error 1004: Method 'Name' of Object" '_Worksheet' failed
    In sub replace_sheet_name() the yellow arrow directs to:
    .Name = MSht.Range("C" & i).

  8. #8
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: automatic replace sheet names based on new cell text (within defined range)

    Robert

    in setup tab first click on get available sheet button next in column C enter the name which u want to replace then click on replace button

  9. #9
    Registered User
    Join Date
    01-28-2014
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: automatic replace sheet names based on new cell text (within defined range)

    Naveed and sktneer, it works perfect! Many thanks!! Rgds, Robert
    Last edited by Robert1311; 05-08-2014 at 05:42 AM.

  10. #10
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: automatic replace sheet names based on new cell text (within defined range)

    Glad i could help you out

    1. If the suggestion helps you, then Click * to Add Reputation and mention your comments
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    Try this updated V2 , this will give u pop up if u missed to enter replace name.
    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)

Similar Threads

  1. replace all defined range names in the sheet that start with "Street" to "Road"
    By matrex in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-04-2016, 08:53 AM
  2. Copy, paste, replace- user defined range in all the defined sheets
    By aganesan99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2014, 12:28 PM
  3. Replies: 10
    Last Post: 07-24-2013, 11:48 AM
  4. Look up text in a cell and replace with pre-defined text from a database.
    By AntonNortje in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-10-2012, 03:55 AM
  5. Replace range names with cell references?
    By KH in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 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