Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
moving workbooks | Excel Discussion (Misc queries) | |||
Links auto update on some workbooks but not others | Excel Worksheet Functions | |||
linked workbooks in different folders... | Links and Linking in Excel | |||
Moving sheets between workbooks | Excel Discussion (Misc queries) | |||
Workbooks...I'll try this again... | Excel Discussion (Misc queries) |