Results 1 to 3 of 3

Save macro to specific folder by date

Threaded View

  1. #1
    Registered User
    Join Date
    01-13-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Save macro to specific folder by date

    Hi,
    I have copied a save macro that saves a worksheet to a specific folder based on the date in a specific cell. The document does save to the right folder to a certain extent, but not to the specific date folder within that folder. The macro I am using is below, if anyone can see why this is please let me know. The original macro was saving to a folder 2005-2007 and i simply deleted this section and started from 2010. Not sure if this is the source of the problem. Many thanks

    Formula in K1 is =YEAR(J7) formula in L1 is =E7&""&K1

    If Range("E7") = "" Then
    MsgBox "Please Enter Airline Name"
    Range("E7").Select
    ElseIf Range("J7") = "" Then
    MsgBox "Please Enter Inception Date"
    Range("J7").Select
    ElseIf Range("K1") = 2010 Then
    ActiveWorkbook.SaveAs Filename:="H:\Models\Saved Models\Air Traffic Control Saved Models\2010" & Range("L1")
    MsgBox "A Copy of this Model Has Now Been Saved in: Models\Saved Models\Air Traffic Control Saved Models\2010"
    ElseIf Range("K1") = 2011 Then
    ActiveWorkbook.SaveAs Filename:="H:\Models\Saved Models\Air Traffic Control Saved Models\2011" & Range("L1")
    MsgBox "A Copy of this Model Has Now Been Saved in: Models\Saved Models\Air Traffic Control Saved Models\2011"
    ElseIf Range("K1") = 2012 Then
    ActiveWorkbook.SaveAs Filename:="H:\Models\Saved Models\Air Traffic Control Saved Models\2012" & Range("L1")
    MsgBox "A Copy of this Model Has Now Been Saved in: Models\Saved Models\Air Traffic Control Saved Models\2012"


    End If



    End Sub
    Last edited by dgtaylor; 01-13-2011 at 01:08 PM.

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