View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
colofnature[_3_] colofnature[_3_] is offline
external usenet poster
 
Posts: 1
Default Macro to copy workbooks from one location to another.


Try this:

Sub copy_contents_of_folder()
sourcepathname = "C:\MyFolder\"
destpathname =
"C:\WINNT\Profiles\MyUserName\Desktop\MyOtherFolde r\"
filemask = "*.xls"
fname = Dir(sourcepathname & filemask, vbNormal)
Do While fname < ""
FileCopy sourcepathname & fname, destpathname & fname
fname = Dir()
Loop
End Sub

Change the values of "sourcepathname" and "destpathname" to the
relevant folders - don't forget the trailing \'s

Hope it helps
Col


--
colofnature
------------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
View this thread: http://www.excelforum.com/showthread...hreadid=543080