View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Flanagan Bob Flanagan is offline
external usenet poster
 
Posts: 340
Default Accessing information from second workbook

If the other workbook is name Book2.xls and has a sheet on it named sheet1,
then

msgbox workbooks("book2.xls").sheets("sheet1").range("a1" ).value

will display the value of cell A1 on that sheet. The following will also do
it:

msgbox workbooks("book2.xls").sheets("sheet1.cells(1,1).v alue

The use of Cells(row number, column number) is often easier to use if you
need to check a large number of cells:

For K = 1 to 5
msgbox workbooks("book2.xls").sheets("sheet1").cells(K, 1).value
Next

displays the values in 5 cells based on the value of variable K.

Robert Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"randland " wrote in message
...
I have been working on this all weekend, and still haven't had any luck.
Any suggestions? Thank you very much

-Nick


---
Message posted from http://www.ExcelForum.com/