Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am working on an excel macro and I need to copy data from another excel
file on a shared network drive. Any suggestions on code needed to copy a cell from a different file and paste in my file? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The easiest way is to open the file and then grab the data:
Sub Macro1() Workbooks.Open Filename:="N:\remote.xls" Windows("remote.xls").Activate Range("A83").Select Selection.Copy Windows("Book1").Activate ActiveSheet.Paste End Sub -- Gary''s Student "Rob Moore" wrote: I am working on an excel macro and I need to copy data from another excel file on a shared network drive. Any suggestions on code needed to copy a cell from a different file and paste in my file? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Turn on the macro recorder and execute a successful find manually. Turn it
off and look at the code. Consult help for an interpretation of the arguments. With find it is always best to assign the values you want to the arguments since they are persistent and may affect the success of your search. Searching for a floating point number may not work because what is actually stored in the cell (or calculated in the cell) may not be exactly what is displayed because of formatting. If I use the options in the find dialog (and an argument in the code) and search for Values rather than formulas, I am successful. If you search for 45.02 and the cell contains 45.0198763, then you probably won't find it looking at formulas. Looking at Values would be successful. At the same time, searching the same range for 45.0198763 is not successful unless I look at formulas. -- Regards, Tom Ogilvy "Gary''s Student" wrote: The easiest way is to open the file and then grab the data: Sub Macro1() Workbooks.Open Filename:="N:\remote.xls" Windows("remote.xls").Activate Range("A83").Select Selection.Copy Windows("Book1").Activate ActiveSheet.Paste End Sub -- Gary''s Student "Rob Moore" wrote: I am working on an excel macro and I need to copy data from another excel file on a shared network drive. Any suggestions on code needed to copy a cell from a different file and paste in my file? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The fastest way:
With Range("B9") .Formula = "='M:\Commonfolder\[Myfiles.xls]Sheet1'!F5" .Formula = .Value End With -- Regards, Tom Ogilvy "Rob Moore" wrote: I am working on an excel macro and I need to copy data from another excel file on a shared network drive. Any suggestions on code needed to copy a cell from a different file and paste in my file? Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Based on Tom's example you can also use
http://www.rondebruin.nl/copy7.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Rob Moore" wrote in message ... I am working on an excel macro and I need to copy data from another excel file on a shared network drive. Any suggestions on code needed to copy a cell from a different file and paste in my file? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CAN I IMPORT DATA FROM A CLOSED FILE TO A NEW WORKSHEET | Excel Discussion (Misc queries) | |||
hi, i am trying to copy data to closed workbook | Excel Programming | |||
Copy range from closed file | Excel Programming | |||
Copy data from a closed workbook (ADO) | Excel Programming | |||
copy data from a closed workbook | Excel Programming |