View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
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