+ Reply to Thread
Results 1 to 4 of 4

Saving file to its current location and current file name with current date and "FINAL"

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Saving file to its current location and current file name with current date and "FINAL"

    I am using 2010 excel and pretty new with VBA codes. I've been looking for a code to save a workbook to its current location and on its current file name but must add the current date and the word FINAL. For example Myfile_08202012_FINAL.xlsx

    I have no luck finding the code. Appreciate any help!

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Saving file to its current location and current file name with current date and "FINAL

    Hi, ironwill20,

    *.xlsx will not support macros. It could be done like

    Please Login or Register  to view this content.
    Ciao,
    Holger

  3. #3
    Registered User
    Join Date
    08-20-2012
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Saving file to its current location and current file name with current date and "FINAL

    Holger....Wow...thanks it really does work.. thanks again.. can I ask a another one? What would be the code If i just wanted to create a backup copy in the same location with this filename --- "Myfile_08202012_backup". I don't want my active workbook to save into this backup filename as I'd like to use the code the one for "FINAL". Basically, I just need a macro the saves a backup so when I run the final one and locked the entire workbook, I know I have a backup copy which is unlocked/unprotected. Hope this is clear...

    this is the code i hav

    Please Login or Register  to view this content.
    The proplem is when it ran the Final save... the filename becomes like this "myfile_08202012_backup_08202012_FINAL.xlsx" I just need the final one say myfile_08202012_FINAL.xlsx



    Quote Originally Posted by HaHoBe View Post
    Hi, ironwill20,

    *.xlsx will not support macros. It could be done like

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Last edited by ironwill20; 08-21-2012 at 03:00 AM.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Saving file to its current location and current file name with current date and "FINAL

    Hi, ironwill20,

    if you want to save the backup as *.xlsx as well itīs a way of using a variable to store the name and open that file again. VBA offers the SaveCopyAs which will leave you in th file and not alter that name but also that will not alter the extension of the file (in ,my case itīs *.xlsm). Please be careful with Application.DisplayAlerts as it will turn off all alarms (workbook not saved, no message when deleting worksheets etc.), so in case of a run-time error please restore this feature:

    Please Login or Register  to view this content.
    Caio,
    Holger

+ 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