Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sub routine | Excel Discussion (Misc queries) | |||
VB routine to print to PDF? | Excel Worksheet Functions | |||
Sort Routine | Excel Discussion (Misc queries) | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
How to create a routine | Excel Discussion (Misc queries) |