Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default automatic choose of dir path

hello

I've got one problem.. I backup some files in excel and I want them to
be in different directories:

if its may 2007
then the file is saved:
C:\backup\2007\may\*.txt

I can write them in chosen directories but I want it to be automatic:
DatePart("yyyy", Date)
and if yyyy = 2007 macro is choosing c:\backup\2007

any help would be helpfull!!
thx

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default automatic choose of dir path

With ActiveWorkbook
.SaveAs "C:\backup\" & DatePart("yyyy", Date) & "\" & .name"
End With


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"bratek" wrote in message
ups.com...
hello

I've got one problem.. I backup some files in excel and I want them to
be in different directories:

if its may 2007
then the file is saved:
C:\backup\2007\may\*.txt

I can write them in chosen directories but I want it to be automatic:
DatePart("yyyy", Date)
and if yyyy = 2007 macro is choosing c:\backup\2007

any help would be helpfull!!
thx



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default automatic choose of dir path

Hi bratek

You can creat the save path like this

MsgBox "C:\backup\" & Format(Date, "yyyy") & "\" & Format(Date, "mmm") & "\"


--
Regards Ron de Bruin
http://www.rondebruin.nl



"bratek" wrote in message ups.com...
hello

I've got one problem.. I backup some files in excel and I want them to
be in different directories:

if its may 2007
then the file is saved:
C:\backup\2007\may\*.txt

I can write them in chosen directories but I want it to be automatic:
DatePart("yyyy", Date)
and if yyyy = 2007 macro is choosing c:\backup\2007

any help would be helpfull!!
thx



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default automatic choose of dir path

thx!!! works perfectly!! maybe except the second option "mmm" I used
"m" and it works :)

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
How can I set up automatic path/file name for new workbooks? WCH ASSISTANT Excel Discussion (Misc queries) 1 October 11th 06 02:33 PM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
Current path to Qualified Path Mary Excel Programming 1 October 14th 04 02:42 PM
Can the user "Choose" the path via a VBA command? Brad Patterson Excel Programming 3 August 15th 03 04:24 PM


All times are GMT +1. The time now is 10:28 PM.

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

About Us

"It's about Microsoft Excel"