+ Reply to Thread
Results 1 to 9 of 9

Macro to rename sheet

  1. #1
    Registered User
    Join Date
    11-08-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    9

    Macro to rename sheet

    Hi There,

    I'm looking at creating a macro that inserts a new workbook and renames it to the value in the bottom of my range.

    So far I have:

    Please Login or Register  to view this content.
    But im getting an error 438. Any advice greatly appreciated.

    Thanks,

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro to rename sheet

    What's SelectRange?

    What'as pagename?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-08-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Macro to rename sheet

    Hi,
    The select range is how I'm trying to select the bottom cell in my range, and page name is the name of the page where that range is, does that make sense?

    Thanks again

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro to rename sheet

    Are they variables that you have given a value. it might be best to attach the workbook

  5. #5
    Registered User
    Join Date
    11-08-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Macro to rename sheet

    Sorry for the delay,

    I've attached the sheet.

    Basically, when the rename button is clicked on the Test sheet, the Test sheet should rename to Dog4 as that is the last entry on the list, if it went up to Dog10, it should rename to Dog10.

    Thanks again
    Attached Files Attached Files

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro to rename sheet

    I think this is what you want. It adds a sheet& renames it

    Please Login or Register  to view this content.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Macro to rename sheet

    Try this
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-08-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Macro to rename sheet

    Thanks very much guys,

    both solutions solve my issue!

    Kind regards,

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro to rename sheet

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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