Hi, I am using macros to go between sheets and I have 20 separate macros for going to different sheets and I have an additional 20 sheets to go back to the home sheet.
I would like some help with how to create two macro/subroutines that replaces these 40 macros with two new macros.
The first macro should take sheet name, scroll area, and tab color as arguments. The second macro should take sheet name and tab color as arguments.
I would like some help with how to create two macro/subroutines that replaces these 40 macros with two new macros.
The first macro should take sheet name, scroll area, and tab color as arguments. The second macro should take sheet name and tab color as arguments.
Code:
Sub StartOption1()
ActiveWorkbook.worksheets("Option1").Visible = True
ActiveWorkbook.worksheets("Home").Visible = False
worksheets("Option1").Activate
Sheets("Option1").ScrollArea = "C1:X37"
Sheets("Option1").Tab.Color = RGB(182, 173, 165)
End Sub
Sub StarOption1Back()
ActiveWorkbook.worksheets("Home").Visible = True
ActiveWorkbook.worksheets("Option1").Visible = False
worksheets("Home").Activate
Sheets("Home").Tab.Color = RGB(182, 173, 165)
End Sub