Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I stop blank workbook from opening when opening an existing | Excel Discussion (Misc queries) | |||
excel VBA problem - setting workbook as variable & opening/re-opening | Excel Programming | |||
How to make the opening of a workbook conditional upon the opening of another workbook | Excel Programming | |||
How to make opening of workbook conditional of opening of another workbook | Excel Programming | |||
Question for Experts: Opening workbook with workbook references | Excel Programming |