PC Review


Reply
Thread Tools Rate Thread

How to copy and paste multiple files

 
 
Ed Dror
Guest
Posts: n/a
 
      25th Apr 2008
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.












 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      25th Apr 2008

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.
>
>
>
>
>
>
>
>
>
>
>
>
>

 
Reply With Quote
 
Ed Dror
Guest
Posts: n/a
 
      25th Apr 2008
Joel,

Thank you very much, It works

Ed Dror


"Joel" <(E-Mail Removed)> wrote in message
news:C7EA8F76-F3E4-4F9D-BF35-(E-Mail Removed)...
>
> 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.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple cells copy & paste aw Microsoft Excel Programming 1 30th Nov 2007 12:16 PM
Files Drag & Drop / Files copy-paste to the clipboard (C# CF2 WinCE 5.0) orenbt78@googlemail.com Microsoft Dot NET Compact Framework 0 27th Jul 2006 05:45 PM
VB macro to load/copy/paste multiple files into one spreadsheet. fjwheeler@gmail.com Microsoft Excel Programming 0 24th Mar 2006 10:56 AM
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Microsoft Excel Programming 1 17th Oct 2005 08:56 AM
Re: copy and paste multiple selections Dave Peterson Microsoft Excel Misc 0 4th Aug 2004 01:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:14 AM.