country101
Board Regular
- Joined
- May 31, 2012
- Messages
- 61
I have a macro already made(thanks to people on here) protect all the worksheets upon leaving. One thing I have noticed as I go into these workbooks is it opens on whatever page you left or saved on. I would like it to open up to the first sheet, which is my master. Could anybody edit the macro so that it always opens to this sheet?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com
ffice
ffice" /><o
></o
>
<o
></o
>
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Select Case ws.Name
Case "Delta Crew"
ws.Protect "delta"
Case "Dumas"
ws.Protect "supervisor"
Case "Fox"
ws.Protect "supervisor"
Case "Freeman"
ws.Protect "supervisor"
Case "Karnes"
ws.Protect "supervisor"
Case "McGee"
ws.Protect "supervisor"
Case "Morris"
ws.Protect "supervisor"
Case "Spanke"
ws.Protect "supervisor"
Case "Data"
With ws
.Protect "delta"
.Visible = xlVeryHidden
End With<o
></o
>
End Select
Next ws
End Sub
<o
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Select Case ws.Name
Case "Delta Crew"
ws.Protect "delta"
Case "Dumas"
ws.Protect "supervisor"
Case "Fox"
ws.Protect "supervisor"
Case "Freeman"
ws.Protect "supervisor"
Case "Karnes"
ws.Protect "supervisor"
Case "McGee"
ws.Protect "supervisor"
Case "Morris"
ws.Protect "supervisor"
Case "Spanke"
ws.Protect "supervisor"
Case "Data"
With ws
.Protect "delta"
.Visible = xlVeryHidden
End With<o
End Select
Next ws
End Sub