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
Hi Ozzie
Why not give it a new name and add a new folder when you are ready
Name quot;C:\Data\quot; As quot;C:\Data quot; amp; Format(Now, quot;dd-mm-yy h-mm-ssquot;) amp; quot;\quot;
MkDir quot;C:\Data\quot;--
Regards Ron de Bruin
www.rondebruin.nlquot;Ozziequot; lt;u18021@uwegt; wrote in message news:5ad7ac35d415c@uwe...
gt;I have a problem in that I currently run a macro that opens all the workbooks
gt; in a particular folder, and merges the data onto one new worksheet, which
gt; works fine.
gt;
gt; However I need to add a bit of code that will move the original workbook into
gt; a new folder called say 'archive' so that the original folder is now empty
gt; and the archive folder is populated??
gt;
gt; anyone have any idea's?, anything appreciated
gt;
gt; Cheers, David
Something along these lines presumably:-
Sub MoveAFile()
Dim fso
Set fso = CreateObject(quot;Scripting.FileSystemObjectquot;)
fso.MoveFile quot;C:\testfile.txtquot;, quot;C:\winnt\testfile.txtquot;
End Sub
quot;Ozziequot; wrote:
gt; I have a problem in that I currently run a macro that opens all the workbooks
gt; in a particular folder, and merges the data onto one new worksheet, which
gt; works fine.
gt;
gt; However I need to add a bit of code that will move the original workbook into
gt; a new folder called say 'archive' so that the original folder is now empty
gt; and the archive folder is populated??
gt;
gt; anyone have any idea's?, anything appreciated
gt;
gt; Cheers, David
gt;
Ron,
Many thanks for your response and for the others, I tried both answers but
your won, it works a treat, thanks againRon de Bruin wrote:
gt;Hi Ozzie
gt;
gt;Why not give it a new name and add a new folder when you are ready
gt;
gt;Name quot;C:\Data\quot; As quot;C:\Data quot; amp; Format(Now, quot;dd-mm-yy h-mm-ssquot;) amp; quot;\quot;
gt;MkDir quot;C:\Data\quot;
gt;
gt;gt;I have a problem in that I currently run a macro that opens all the workbooks
gt;gt; in a particular folder, and merges the data onto one new worksheet, which
gt;[quoted text clipped - 7 lines]
gt;gt;
gt;gt; Cheers, David
--
Message posted via OfficeKB.com
www.officekb.com/Uwe/Forums.a...excel/200601/1
- Oct 22 Sun 2006 20:10
Moving workbooks between folders
close
全站熱搜
留言列表
發表留言