+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] automatic choose of dir path

  1. #1
    bratek
    Guest

    [SOLVED] 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. #2
    Bob Phillips
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Ron de Bruin
    Guest

    Re: 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" <[email protected]> wrote in message news:[email protected]...
    > 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. #4
    bratek
    Guest

    Re: automatic choose of dir path

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


+ Reply to Thread

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