View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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.