View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Martin Fishlock Martin Fishlock is offline
external usenet poster
 
Posts: 694
Default getting data from another workbook

Dave:

The excel workbook is C:\Myfilename.xls
The excel sheet is Handicap
The cell is, well lets assume A1.

To get the value from the above we do this assuming that the workbook is open:

workbooks("Myfilename.xls").worksheets("Handicap") .range("A1")

So we could put the value in the a cell with

workbooks("book1.xls").worksheets("sheet1").range( "B3") =
workbooks("Myfilename.xls").worksheets("Handicap") .range("A1")

If the workbook is not open you can paste the link into workbook and using
linking:

activesheet.range("B3").formula= "'[c:\Myfilename.xls]Handicap'!A1"

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Dave Marden" wrote:

I need to get some data from another workbook, could anyone give me a hand
with this?


The following is what I kind of figured would work but I am unsure of the
syntax for addressing the actual cell the following calls for the data in
C:\Myfilename.xlsHandicap. This is obviously not the correct sytax.

'Dim Location As String
'Location = Range("ReadFromFilename").Text & "Handicap"
'Range("Handicap") = Range(Location)

I have searched for this and have had no luck.

Thanks In Advance,
Dave Marden