View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default How to copy and paste multiple files


Sub Button1_Click()

RowCount = 1
do while Range("A" & RowCount) < ""
FileCopy Range("A" & RowCount), Range("B" & RowCount)
RowCount = RowCount + 1
loop
End Sub



"Ed Dror" wrote:

Hi there,

I'm using excel 2007 and I wrote

Sub Button1_Click()
FileCopy "C:\Excel\book1.txt" , "C:\Excel\Test\book2.txt"
End Sub

Everything works file but lets assume I have in my spreadsheet two columns

Column A = Source directory looks like this

C:\Source\file1.txt
C:\Source\file2.xls
....
And so on

Column B = Destination looks like this
C:\Destination\file11.txt
C:\Destination\file22.xls
....
And so on

My question is how make the copy and paste function to read the copy and
paste from the spreadsheet itself
Until the end of the list of files

Thanks,
Ed Dror
Andrew Lauren Co.