Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code to copy data from 1 file to another

I want to copy data from one range in a file that is on 1
network drive- \\dnvr-fil01\Melb\SC\Rosters and Employee
Lists\Employees List.xls to a file on the same drive but
different folder \\dnvr-fil01\Melb\SC\T.D\ATO.xls The
Range is simply A2:A100 to A2:A100 I'd like to use code to
do this. Any help?

Here is what I used and it doesn't populate the ATO file
Private Sub CB1_Click()
Worksheets("Sheet1").Range("A2:A100").Value = Workbooks_
("Sprint Employees.xls").Worksheets("Agents").Range_
("A2:A100").Value
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Code to copy data from 1 file to another

You can't reference a range in a closed file in that manner. You need to use
a workaround such as this one from John Walkenbach's site:

http://j-walk.com/ss/excel/tips/tip82.htm

--

Vasant



"The Gza" wrote in message
...
I want to copy data from one range in a file that is on 1
network drive- \\dnvr-fil01\Melb\SC\Rosters and Employee
Lists\Employees List.xls to a file on the same drive but
different folder \\dnvr-fil01\Melb\SC\T.D\ATO.xls The
Range is simply A2:A100 to A2:A100 I'd like to use code to
do this. Any help?

Here is what I used and it doesn't populate the ATO file
Private Sub CB1_Click()
Worksheets("Sheet1").Range("A2:A100").Value = Workbooks_
("Sprint Employees.xls").Worksheets("Agents").Range_
("A2:A100").Value
End Sub



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
copy data for match word from one file to another file mishak Excel Worksheet Functions 1 December 2nd 09 02:11 AM
vba code for excel to extract data from txt file JE New Users to Excel 3 June 11th 07 09:19 PM
Code to Copy Data from One Spreadsheet To Another Rob Excel Discussion (Misc queries) 9 June 9th 07 11:03 AM
How do I copy data from a cell in one file to another? acraig New Users to Excel 1 February 15th 05 03:09 PM
using vba copy data from .csv file into an excel spreadsheet vineeta Excel Programming 1 October 31st 03 12:57 PM


All times are GMT +1. The time now is 12:06 PM.

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"