Grouping Workbooks

scanavan

New Member
Joined
Jul 27, 2007
Messages
10
Does anyone know if it is possible to group workbooks. The idea being that if one particular workbook is opened several other defined workbooks automatically open.

Thanks

Stephen
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
scanavan,

With the Master workbook (first workbook) open, you could record a macro to do this.

Click on Tools, Macro, Record New Macro...

In the 'Record Macro' box:
Within the 'Macro name:' box, enter the name of the macro 'OpenTwoWorkbooks'
Within the 'Store macro in:' box, make sure it says 'This Workbook'
And, click on the 'OK' button

Click on File, Open, and search/browse for the first file, and double click on it.

Click on File, Open, and search/browse for the second file, and double click on it.

Then click on the 'Stop Macro' button.

Press and hold down the 'Alt' key, and press the 'F11' key, to open the VBA Editor.

On the left side of the screen, click on and expand the link/levels for your Master File.

Click on this 'ThisWorkbook':
Change 'General' to 'Workbook', and it shoud fill in 'Workbook_Open'

In 'Module1', copy the code above the 'End Sub' and below the last apostrophie:
Code:
Sub OpenTwoWorkbooks()
'
' OpenTwoWorkbooks Macro
' Macro recorded 7/28/2007 by Stanley D. Grom, Jr.
'

'
    Workbooks.Open Filename:= _
        "C:\Users\sgrom001\Documents\Excel2003\TEST\One Workbook.xls"
    Workbooks.Open Filename:= _
        "C:\Users\sgrom001\Documents\Excel2003\TEST\Two Workbook.xls"
End Sub


And paste the code into the 'Workbook_Open":

Code:
Private Sub Workbook_Open()

    Workbooks.Open Filename:= _
        "C:\Users\sgrom001\Documents\Excel2003\TEST\One Workbook.xls"
    Workbooks.Open Filename:= _
        "C:\Users\sgrom001\Documents\Excel2003\TEST\Two Workbook.xls"

End Sub

Press and hold down the 'Alt' key, and press the 'F11' key, to close the VBA Editor.

Save the Master file, and close it.

Close the two files you just opened.

Open the Master file, and the other two files should open.

Have a great day,
Stan
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,746
Members
449,050
Latest member
excelknuckles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top