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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Joined
Jul 30, 2006
Messages
3,656
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
 

Forum statistics

Threads
1,181,658
Messages
5,931,269
Members
436,785
Latest member
KingGideon

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
Top