LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 183
Default values from workbook without opening it

hello
I would like to use the values of a range (same range in same worksheet
name), but from different workbooks (could be up to 40).


I am currently doing it but my code involves opening each workbook which is
cumbersome.
Once the workbook are opened the following code is applied
' Test to see if the file is open. if not opened then message
If Not IsFileOpen(Range("WorkbookNameCell1").Offset(i, 0).Value)
Then
MsgBox "" & Range("WorkbookNameCell1").Offset(i, 0).Value &
" is not opened or the workbook name is misspell." & vbCr & vbCr & _
"Open it or check the spelling on your list (do not forget
the extension .xls)"
Range("WorkbookNameCell1").Offset(i, 0).Select
Exit Sub

End If

'take appropriate values
Dim i As Long
For i = 0 To 29
Dim Expt(1 To 8) As Range
Set Expt(1) = Workbooks(Range("WorkbookNameCell1").Offset(i,
0).Value).Worksheets("Forecast").Range("H8:I39")
etc

In order not to open the workbooks, and because I do not know in advance
which path the user will be using,
I would like to write the path in a cell
MyPath = Range("PathName").Value
and add the path in the code, so I do not have to open each workbook.

Any help greatly appreciated. Thanks
--
caroline
 
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
How do I stop blank workbook from opening when opening an existing kjg Excel Discussion (Misc queries) 3 February 12th 10 09:36 PM
excel VBA problem - setting workbook as variable & opening/re-opening safe Excel Programming 1 August 20th 04 12:22 AM
How to make the opening of a workbook conditional upon the opening of another workbook Marcello do Guzman Excel Programming 1 December 16th 03 06:09 AM
How to make opening of workbook conditional of opening of another workbook turk5555[_2_] Excel Programming 2 December 15th 03 11:07 PM
Question for Experts: Opening workbook with workbook references Chris Excel Programming 0 September 11th 03 07:05 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"