+ Reply to Thread
Results 1 to 3 of 3

Conditional saving in a given directory, with always changing file name

  1. #1
    Forum Contributor
    Join Date
    08-01-2007
    Posts
    110

    Conditional saving in a given directory, with always changing file name

    Hi there Everyone. This may seem a little bit difficult.

    So I would like to have a macro which does the following things.

    1. If the „Data” sheet D3 cell contains OK. The file should be saved. The saving should work in the following way. Save as... O://finance/financial control/shared files/

    2. If the D3 cell is OK then first there should be a pop up message box asking: „Do you want to save the file?” There should be two options: „Yes” and „No”.

    3. If „No” is pressed then the macro should terminate.

    4. If the answer is yes, then the file name should be saved as „Processing file <yesterday’s date>.xls (I know this needs some explanation. So if today is 23-AUG-2007 the file should be saved as: „O://finance/financial control/shared files/Processing file 22.08.2007.xls”)

    5. If there’s already a file with the same date, then NEVER overwrite but save as: Processing file <yesterday’s date>b.xls. (So if today is 23-AUG-2007 and in the given directory there is already a file named:” Processing file 22.08.2007.xls”, the file should be saved as: „O://finance/financial control/shared files/Processing file 22.08.2007b.xls”)

    Can a macro do this? Thanks in advance!

  2. #2
    Forum Contributor
    Join Date
    03-24-2004
    Location
    Edam Netherlands
    Posts
    181
    What if

    „O://finance/financial control/shared files/Processing file 22.08.2007b.xls”

    Already exists.....?

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481
    Hi there,

    VBA code certainly CAN do what you describe.

    Do you want to trigger the VBA using a button/menu command, or do you want to trigger it automatically as soon as a user types "OK" in Data.D3? Either is possible.

    Regards,

    Greg M

+ 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