I have an amazing macro (see below) but I need some additional things added to it. It will be painfully obvious I'm not a coder as I've tried to add these simple things and just keep getting errors. THANK YOU SO MUCH FOR HELPING ME OUT.
In addition to the VBA code below I'd like to add the following to be automatic upon opening file (note this is my template and some versions may have more or less than 3 dash* tabs)
1. Hide:
Both Scroll bars
all Tabs
Formula bar
Gridlines
Headings
Tool bar
Status bar
2. For all Dash* Tabs (dash1, dash2, dash3, etc):
Lock scroll area to A1:Z41
Zoom to A1:Z41 (so regardless of what screen size is being used it zooms to this area in full)
3. Always open to Dash1 cell A1
4. Protect all sheets with ‘password’ (allow users to select unlocked cells only)
Protect workbook with ‘password’
CURRENT VBA CODE:
Option Explicit
Dim oSheet As Object
Dim bSaved As Boolean
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Application.EnableEvents = False
Call sbShowSheets
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Sub sbShowSheets()
On Error Resume Next
For Each oSheet In ActiveWorkbook.Sheets
If oSheet.Name <> shtSplash.Name Then oSheet.Visible = xlSheetVisible
Next oSheet
shtSplash.Visible = xlSheetVeryHidden
info.Visible = xlSheetVeryHidden
data.Visible = xlSheetVeryHidden
pivot.Visible = xlSheetVeryHidden
ActiveWorkbook.Saved = True
On Error GoTo 0
End Sub
Sub sbHideSheets()
On Error Resume Next
shtSplash.Visible = xlSheetVisible
For Each oSheet In ActiveWorkbook.Sheets
If oSheet.Name <> shtSplash.Name Then oSheet.Visible = xlSheetVeryHidden
Next oSheet
On Error GoTo 0
End Sub
In addition to the VBA code below I'd like to add the following to be automatic upon opening file (note this is my template and some versions may have more or less than 3 dash* tabs)
1. Hide:
Both Scroll bars
all Tabs
Formula bar
Gridlines
Headings
Tool bar
Status bar
2. For all Dash* Tabs (dash1, dash2, dash3, etc):
Lock scroll area to A1:Z41
Zoom to A1:Z41 (so regardless of what screen size is being used it zooms to this area in full)
3. Always open to Dash1 cell A1
4. Protect all sheets with ‘password’ (allow users to select unlocked cells only)
Protect workbook with ‘password’
CURRENT VBA CODE:
Option Explicit
Dim oSheet As Object
Dim bSaved As Boolean
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Application.EnableEvents = False
Call sbShowSheets
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Sub sbShowSheets()
On Error Resume Next
For Each oSheet In ActiveWorkbook.Sheets
If oSheet.Name <> shtSplash.Name Then oSheet.Visible = xlSheetVisible
Next oSheet
shtSplash.Visible = xlSheetVeryHidden
info.Visible = xlSheetVeryHidden
data.Visible = xlSheetVeryHidden
pivot.Visible = xlSheetVeryHidden
ActiveWorkbook.Saved = True
On Error GoTo 0
End Sub
Sub sbHideSheets()
On Error Resume Next
shtSplash.Visible = xlSheetVisible
For Each oSheet In ActiveWorkbook.Sheets
If oSheet.Name <> shtSplash.Name Then oSheet.Visible = xlSheetVeryHidden
Next oSheet
On Error GoTo 0
End Sub