Macro should not Run when Excel Sheet is Protected

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Some of the defined Macros should not work when a Sheet is Protected and only
the specific Users should have access
 
Hi
you could check in the macro if the sheet is protected. e.g. directly
from the VBA help:
If Worksheets("Sheet1").ProtectContents = True Then
MsgBox "The contents of Sheet1 are protected."
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top