Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default File Copy Routine

Can anyone suggest a little code to do the following.

I will have a list of paths and files starting in cell A1
and going down like this:-
c:\dir\dir\filename.ext
and in column B going down I will have a destination dir
c:\backup\dir\dir\filename.ext

I want to run a loop that moves down column A copying the
files identified in each cell to the location identified
in column B.

Many thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default File Copy Routine

Assuming the files are not open:

Sub CopyList()
Dim rng as Range
Dim cell as Range
set rng = Range(Cells(1,1),Cells(rows.count,1).End(xlup))
for each cell in rng
if not( isempty(cell) or isempty(cell.offset(0,1))) then
filecopy cell.value, cell.offset(0,1).value
End if
Next
End Sub

--
Regards,
Tom Ogilvy


"Neil" wrote in message
...
Can anyone suggest a little code to do the following.

I will have a list of paths and files starting in cell A1
and going down like this:-
c:\dir\dir\filename.ext
and in column B going down I will have a destination dir
c:\backup\dir\dir\filename.ext

I want to run a loop that moves down column A copying the
files identified in each cell to the location identified
in column B.

Many thanks in advance.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sub routine Gord Dibben Excel Discussion (Misc queries) 0 November 13th 09 12:15 AM
VB routine to print to PDF? fedude Excel Worksheet Functions 4 March 15th 08 02:04 AM
Sort Routine Platinum girl[_2_] Excel Discussion (Misc queries) 0 March 9th 07 03:21 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
How to create a routine Tara Excel Discussion (Misc queries) 1 August 12th 05 02:28 AM


All times are GMT +1. The time now is 09:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"