Msgbox to unprotect worksheet on first activation only?

Ironman

Well-known Member
Joined
Jan 31, 2004
Messages
1,069
Office Version
  1. 365
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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
VBA Code:
Private Sub Worksheet_Activate()
    If Me.ProtectContents Then
        MsgBox "Unprotect Worksheet ", vbInformation, "Daily Tracking"
    End If
End Sub
 
Upvote 0
Solution
Brilliant, it worked fine!

Many thanks to you!
 
Upvote 0

Forum statistics

Threads
1,215,365
Messages
6,124,513
Members
449,168
Latest member
CheerfulWalker

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
Back
Top