Results 1 to 9 of 9

Macro to save duplicate file and create folder name based on cell value

Threaded View

  1. #1
    Registered User
    Join Date
    11-22-2009
    Location
    Newcastle,England
    MS-Off Ver
    Excel 2003
    Posts
    78

    Macro to save duplicate file and create folder name based on cell value

    I currently use the following code to create a duplicate file based on two cells within a directory and folder i specify. These cells consist of the team and week commencing date (mondays date of week which is cell 'Main Menu'!K8)


    Private Sub Workbook_BeforeSave(ByVal _
      SaveAsUI As Boolean, Cancel As Boolean)
        With ThisWorkbook
            .SaveCopyAs ("\\dfz70588\106124001\workgroup\Fraud Error Strategy Team\Recovery\Roll up work\testfolder\" & Range("'Main Menu'!H5").Value & ("-") & Format(Range("'Main Menu'!K8"), "DD.MM.YYYY") & ".xls")
        End With
    End Sub
    However I now want to be able to create an archive of past weeks duplicates by creating a folder based on the week commencing date ('Main Menu'!K8). I want the above macro to first check if the folder exists and if not to create it with the date ('Main Menu'!K8), if it does to simply save itself to that folder.

    Thanks for any help
    Last edited by munkee; 11-26-2009 at 04:03 AM.

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