+ Reply to Thread
Results 1 to 4 of 4

CReate a new workbook and copy the name of another workbook

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

    CReate a new workbook and copy the name of another workbook

    Hi,

    I have some code which when run from my "main" workbook it creates a new workbook then saves it to the same location as my "main" workbook. What I also need to be able to do is copy the workbook name of my "main" workbook and add a date and timestamp to the end of the filename. I can't hardcode it as "main" because this workbook name changes.

    Any ideas?

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: CReate a new workbook and copy the name of another workbook

    You can try with this macro:
    Please Login or Register  to view this content.
    Regards,
    Antonio

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

    Re: CReate a new workbook and copy the name of another workbook

    Thanks but I need the code to use the name of the "main" workbook without forcing it by hardcoding the name in the VBA. THe problem is, the name of the workbook will change and won't always be called "main" as it depends on what the user wants to call it. SO I need the code to create a new workbook with the same name as the workbook where the code is run from and add the date and time stamp.

    Does that make sense?

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: CReate a new workbook and copy the name of another workbook

    I hope this code is what you need:
    Please Login or Register  to view this content.
    Regards,
    Antonio

+ 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