Msgbox to unprotect worksheet on first activation only?

Ironman

Board Regular
Joined
Jan 31, 2004
Messages
203
Office Version
  1. 2019
Platform
  1. Windows
Hello

I created a simple msgbox to remind me to unprotect a particular worksheet that is protected when the workbook is opened (there are 12 other tabs that aren't protected).

VBA Code:
Private Sub Worksheet_Activate()

MsgBox "Unprotect Worksheet ", vbInformation, "Daily Tracking"

Is it possible for a line or two of code that stops any further (irrelevant) messages when I have unprotected the sheet, while the workbook is still open?

Thanks!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

John_w

MrExcel MVP
Joined
Oct 15, 2007
Messages
6,905
VBA Code:
Private Sub Worksheet_Activate()
    If Me.ProtectContents Then
        MsgBox "Unprotect Worksheet ", vbInformation, "Daily Tracking"
    End If
End Sub
 
Solution

Ironman

Board Regular
Joined
Jan 31, 2004
Messages
203
Office Version
  1. 2019
Platform
  1. Windows
Brilliant, it worked fine!

Many thanks to you!
 

Forum statistics

Threads
1,137,114
Messages
5,679,708
Members
419,852
Latest member
ddewaard17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top