Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to set up a macro that looks in the contents of a cell, for
example E9, and determines the file path and file name to save the file. E9 will contain a date. Based on the date, the macro will need to select the correct folder: Cell E9 = 8/9/07 File path & name = C:\2007\(08) August\MCBS 08-09-2007.xls Any suggestions? I appreciate it. Adam |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
mpPath ="C:\" & Year(Range("E9").Value) & "\(" & Format(Range("E9").Value,
"mm) mmmm") & "\MCBS " & Format(Range("E9").Value, "mm-dd-yyyy") -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "watchtower" wrote in message ... I am trying to set up a macro that looks in the contents of a cell, for example E9, and determines the file path and file name to save the file. E9 will contain a date. Based on the date, the macro will need to select the correct folder: Cell E9 = 8/9/07 File path & name = C:\2007\(08) August\MCBS 08-09-2007.xls Any suggestions? I appreciate it. Adam |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
a = Format(Range("E9"), "yyyy") ' 2007
b = Format(Range("E9"),"("& "mm" &")") ' (08) c = Format(Range("E9"),"mmmm") ' August ActiveWorkbook.Saveas Filename:="C:\" & a & "\" & b & " " & c & "\MCBS 08-09-2007.xls" -- Best wishes, Jim "watchtower" wrote: I am trying to set up a macro that looks in the contents of a cell, for example E9, and determines the file path and file name to save the file. E9 will contain a date. Based on the date, the macro will need to select the correct folder: Cell E9 = 8/9/07 File path & name = C:\2007\(08) August\MCBS 08-09-2007.xls Any suggestions? I appreciate it. Adam |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SAVE & SEND A FILE BASED ON TEXT IN A CELL VIA MACRO | New Users to Excel | |||
Save new file in same directory | Excel Programming | |||
file save error: the file or directory cannot be created | Excel Discussion (Misc queries) | |||
Save File to Another Directory, but not change Users File Save location | Excel Programming | |||
Macro to insert values from a file and save another sheet as a .txt file | Excel Programming |