+ Reply to Thread
Results 1 to 4 of 4

Moving workbooks between folders

  1. #1
    Ozzie
    Guest

    Moving workbooks between folders

    I have a problem in that I currently run a macro that opens all the workbooks
    in a particular folder, and merges the data onto one new worksheet, which
    works fine.

    However I need to add a bit of code that will move the original workbook into
    a new folder called say 'archive' so that the original folder is now empty
    and the archive folder is populated??

    anyone have any idea's?, anything appreciated

    Cheers, David

  2. #2
    Ron de Bruin
    Guest

    Re: Moving workbooks between folders

    Hi Ozzie

    Why not give it a new name and add a new folder when you are ready

    Name "C:\Data\" As "C:\Data " & Format(Now, "dd-mm-yy h-mm-ss") & "\"
    MkDir "C:\Data\"


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


    "Ozzie" <u18021@uwe> wrote in message news:5ad7ac35d415c@uwe...
    >I have a problem in that I currently run a macro that opens all the workbooks
    > in a particular folder, and merges the data onto one new worksheet, which
    > works fine.
    >
    > However I need to add a bit of code that will move the original workbook into
    > a new folder called say 'archive' so that the original folder is now empty
    > and the archive folder is populated??
    >
    > anyone have any idea's?, anything appreciated
    >
    > Cheers, David




  3. #3
    bigwheel
    Guest

    RE: Moving workbooks between folders

    Something along these lines presumably:-

    Sub MoveAFile()
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.MoveFile "C:\testfile.txt", "C:\winnt\testfile.txt"
    End Sub

    "Ozzie" wrote:

    > I have a problem in that I currently run a macro that opens all the workbooks
    > in a particular folder, and merges the data onto one new worksheet, which
    > works fine.
    >
    > However I need to add a bit of code that will move the original workbook into
    > a new folder called say 'archive' so that the original folder is now empty
    > and the archive folder is populated??
    >
    > anyone have any idea's?, anything appreciated
    >
    > Cheers, David
    >


  4. #4
    david giles via OfficeKB.com
    Guest

    Re: Moving workbooks between folders

    Ron,

    Many thanks for your response and for the others, I tried both answers but
    your won, it works a treat, thanks again


    Ron de Bruin wrote:
    >Hi Ozzie
    >
    >Why not give it a new name and add a new folder when you are ready
    >
    >Name "C:\Data\" As "C:\Data " & Format(Now, "dd-mm-yy h-mm-ss") & "\"
    >MkDir "C:\Data\"
    >
    >>I have a problem in that I currently run a macro that opens all the workbooks
    >> in a particular folder, and merges the data onto one new worksheet, which

    >[quoted text clipped - 7 lines]
    >>
    >> Cheers, David


    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...excel/200601/1

+ 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