I have 2 excel files
- stage1
- Menu
- Data
- stage2
- Calculation
- Charts
I am trying to jump back and forth from these two files linking to certain sheet of the workbook its jumping to.
Option Explicit
Dim stage1 As Workbook
Dim stage2 As Workbook
Sub Open_stage1_Menu()
Set stage1 = Workbooks.Open(ActiveWorkbook.Path & "\stage1.xlsm")
stage1.Sheets("Menu").Activate
End Sub
Sub Open_stage1_Data()
Set stage1 = Workbooks.Open(ActiveWorkbook.Path & "\stage1.xlsm")
stage1.Sheets("Data").Activate
End Sub
Sub Open_stage2_Calculation()
Set stage2 = Workbooks.Open(ActiveWorkbook.Path & "\stage2.xlsm")
stage2.Sheets("Calculation").Activate
End Sub
Sub Open_stage2_Charts()
Set stage2 = Workbooks.Open(ActiveWorkbook.Path & "\stage2.xlsm")
stage2.Sheets("Charts").Activate
End Sub
All of the Macros are stored in the stage1 workbook. I've implemented buttons to navigate through sheets, but jumping to stage2 cause error (Subscript out of range) but not towards stage1.