mikeinvirginia
New Member
- Joined
- Nov 18, 2021
- Messages
- 3
- Office Version
- 2021
- Platform
- Windows
Hi all,
Thank you for all the expertise. I have a marco to clear some cells and to disable the save prompt. I need to add one more step. Force the user to enable macros. I found a few options but I am too noob to make them work. I appreciate any help to add a very hidden code to my current code.
Current - To Clear Cells & Disable Prompt
Option Found for Welcome Screen & Very Hidden
Thank you for all the expertise. I have a marco to clear some cells and to disable the save prompt. I need to add one more step. Force the user to enable macros. I found a few options but I am too noob to make them work. I appreciate any help to add a very hidden code to my current code.
Current - To Clear Cells & Disable Prompt
VBA Code:
Private Sub Workbook_Open()
Application.EnableEvents = False
Worksheets("Calculator").Range("C4:C5").Value = ""
Application.EnableEvents = True
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Worksheets("Calculator").Range("C4:C5").Value = ""
Application.DisplayAlerts = False
Me.Saved = True
End Sub
Option Found for Welcome Screen & Very Hidden
VBA Code:
Private Sub Workbook_Open()
'worksheets to show when macro is enabled
WorkSheets("Calculator").Visible = True
'worksheet that shows reminder to enable macro
WorkSheets("Prompt").Visible = xlVeryHidden
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'worksheet with reminder
WorkSheets("Prompt").Visible = True
'worksheets to show when macro is enabled
WorkSheets("Calculator").Visible = xlVeryHidden
ThisWorkbook.Save