using a workbook to open more workbooks with filenames stored in cells
Private Sub Workbook_Open()
With Worksheets("Sheet1")
Workbooks.Open Filename:=.Range("A1").Value
Workbooks.Open Filename:=.Range("A2").Value
Workbooks.Open Filename:=.Range("A3").Value
'etc.
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
--
---
HTH
Bob
(change the xxxx to gmail if mailing direct)
wrote in message
ups.com...
hello
i am having issues using VBA code for opening up workbooks within a
workbook.
i need to open up 6 other workbooks when the master workbook is opened.
i was playing around with some code i found on this group and i got 1
to work, but then when it tried to open the second one it said error
1004 cannot open " or something like that.
i have filenames of the workbooks i need to open stored in cells.
i know i'm supposed to use some form of Workbooks.Open code in this
somewhere, but thats about all i've got down, minus referencing the
cells.
sorry i'm a newb but we all have to start somewhere.
anyone have any ideas for this code? for opening multiple workbooks?
thanks in advance!
aaron ward
|