Von Pookie
MrExcel MVP
- Joined
- Feb 17, 2002
- Messages
- 13,686
I currently have a blank workbook with nothing but the code, so that when I open it, it will run the macro and open certain sheets.
Can I add on to this so that after it is finished running, it will close the original worksheet?
This is what I currently have:
Thankee much.
Can I add on to this so that after it is finished running, it will close the original worksheet?
This is what I currently have:
Code:
Private Sub Workbook_Open()
On Error GoTo myErr
ChDir "directory"
Workbooks.Open "workbook1.xls"
Workbooks.Open "workbook2.xls"
Which = Application.GetOpenFilename(MultiSelect:=True)
'Which now contains an array of file names which you can enumerate through
For I = 1 To UBound(Which)
Workbooks.Open Which(I)
Next
End
myErr:
End Sub
Thankee much.