+ Reply to Thread
Results 1 to 4 of 4

Rename a Workbook from within VBA

  1. #1
    Registered User
    Join Date
    10-30-2014
    Location
    Melton Mowbray, England
    MS-Off Ver
    2010
    Posts
    1

    Question Rename a Workbook from within VBA

    Hi, all. I am desperately trying to save worktime by automating as many "routine" processes as I can, mainly by using macros & VB code within Excel. The new (to me) VBA code in Excel has been a challenge, but I've managed to flog my way through most of the procedures I need. Except one! Renaming a Workbook (or open spreadsheet) from within.
    It is so simple, but I just cannot crack it. Can anyone out there please help?
    The story behind it is that I have created a "master" spreadsheet (Excel 2010), but each month, I need to copy certain sheets into a "new" spreadsheet. I have saved a template, can open it from within my "master" using VBA, copy the sheets across to it, again using VBA, but just cannot find out how to rename it from within the master program. For instance, with that particular month's date.
    I am starting to go bald with the amount of hair-pulling ... please help.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Rename a Workbook from within VBA

    Have you looked at using SaveAs?
    If posting code please use code tags, see here.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Rename a Workbook from within VBA

    Hi Peter,

    Just SaveAs using the Path of the workbook and the new name:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Rename a Workbook from within VBA

    Hi Peter,

    A belated welcome to the Forum - and, thanks for the rep!

+ 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: 0
    Last Post: 07-24-2014, 09:11 AM
  2. copy sheets to new workbook with new name, rename tabs within that workbook
    By Conky4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2012, 04:44 PM
  3. Rename all tabs in workbook
    By DiDi in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-22-2010, 02:10 PM
  4. Rename a new workbook
    By Jan Eric Nilsson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2005, 10:05 PM
  5. [SOLVED] How can I rename a Workbook?
    By Mac Lingo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2005, 05:07 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