Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Macro Selects Directory to Save File Based on Sheet Criteria

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Macro Selects Directory to Save File Based on Sheet Criteria

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default Macro Selects Directory to Save File Based on Sheet Criteria

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SAVE & SEND A FILE BASED ON TEXT IN A CELL VIA MACRO Pat Baratta New Users to Excel 1 February 26th 07 06:46 AM
Save new file in same directory Gert-Jan[_2_] Excel Programming 2 October 19th 06 07:43 PM
file save error: the file or directory cannot be created dublg Excel Discussion (Misc queries) 1 September 25th 06 07:07 PM
Save File to Another Directory, but not change Users File Save location Mike Knight Excel Programming 1 May 28th 04 09:06 PM
Macro to insert values from a file and save another sheet as a .txt file Frank[_16_] Excel Programming 2 August 28th 03 01:07 AM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"