+ Reply to Thread
Results 1 to 5 of 5

Save as cell + date macro

  1. #1
    Registered User
    Join Date
    02-02-2010
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2003
    Posts
    22

    Save as cell + date macro

    Hi,

    I have an excel template workbook that I’m re-using. I would like to create a macro that saves a workbook as a copy of the existing template workbook, creates a new folder for the workbook I want to save (if not already existing) then include another statement to clear the data cells on the template workbook so that I can reuse it without having to close and re-open it:

    1.
    Create a copy of the template workbook and Save as:
    Col "J1" (customer) + col "J3" (product) + today’s date.

    2.
    Where to save it:
    C:\Client\(and the customer sub folder)
    If the customer sub folder does not exist, then create a new folder with the customer name as in "J1".

    3.
    When saved, close the newly saved workbook and wipe out the information from template workbook so that I can re-use it again without re-opening it.

    Anyone that can help me w. this?
    I have found different options on the internet but nothing that does all of the above I'm asking for. I'm a newbie when it comes to macros so don't have the skills to come up w. a solution on my own.

    Thanks & Regards,
    Susanne
    Last edited by Sanne; 03-12-2010 at 01:51 AM.

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: Save as cell + date macro

    Hi
    try these codes for a start
    Please Login or Register  to view this content.
    ravi

  3. #3
    Registered User
    Join Date
    02-02-2010
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Save as cell + date macro

    Hi Ravi,

    The code doesn't work. Also, this code doesn't search for the client sub folder, nor creating a new sub folder if non existent.

    Don't know if what I'm asking for is even possible?

    Regards,
    Susanne

  4. #4
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Save as cell + date macro

    I would suggest putting your code in a separate hidden workbook and then use the macro from that book to save your file and then re-open the template for the next customer. The advantage is that you won't be saving the macro with each file, you'll only be saving the file.

    Another option would be to use an actual template file (xlt extension) instead of the xls version of the file. The advantage being there would be no need to worry about clearing the fields once the Save As occurs since the template file will revert back to it;s original form.

    I've attached an example of the hidden workbook. When it's opened, it will create a new menu item called ClientSaver which will launch this macro (it will also be hidden ):

    Please Login or Register  to view this content.
    Using the Workbooks.Add and specifying a workbook allows for the use of an XLS file as the template file.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-02-2010
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Save as cell + date macro

    Hi,

    Thanks for your help. Perfect.

    Regards,
    Sanne

+ 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