SamAnnElizabeth
New Member
- Joined
- Mar 15, 2013
- Messages
- 34
I recorded a Macro and then went to edit it in VBA. This is what I have:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, cancel As Boolean)
'
' Protect Macro
'
'
Sheets("Program").Visible = True
Sheets("List1").Visible = True
Sheets("Status").Visible = True
Sheets(Array("Program", "Status", "List1")).Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("All Programs").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFiltering:=True
Range("Current", "Rating").Select
Range("Issues").Select
Selection.Locked = False
End Sub
When I try to run it (the play button) a dialogue box pops up to pick a macro, and my macro isn't on the list! Any advice on how to fix it? Thanks!
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, cancel As Boolean)
'
' Protect Macro
'
'
Sheets("Program").Visible = True
Sheets("List1").Visible = True
Sheets("Status").Visible = True
Sheets(Array("Program", "Status", "List1")).Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("All Programs").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFiltering:=True
Range("Current", "Rating").Select
Range("Issues").Select
Selection.Locked = False
End Sub
When I try to run it (the play button) a dialogue box pops up to pick a macro, and my macro isn't on the list! Any advice on how to fix it? Thanks!