Protectected cell ignore

  • Thread starter Thread starter Guest
  • Start date Start date
You could have a macro that does the protecting--put it in your auto_open
or workbook_open event:

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
.Protect Password:="hi"
.EnableSelection = xlUnlockedCells
End With
End Sub


Excel won't remember this setting after you close it and reopen the workbook
(that's why it's in auto_open).
 
Thank you Dave but all I really want to do is stop the warning message. I do not want to alter the protected cell.
 
Thank you, but all I want is to prevent the message. I do not really want to gain access to the cell.
 
Thank you. All I really want is for the warning message to be cancelled. In other words if someone wants to change a protected cell, nothing happens

I do not want to change the contents of a protected cell.
 
You can't intercept this message, but you can stop the user from selecting a
cell that could cause the message to pop up (if they tried to change it).

This line:
..EnableSelection = xlUnlockedCells
limits the cells the users can click on. Hence, the warning message won't
appear.

(This won't allow a user to change a locked cell on a protected worksheet.)

==
But as an aside, worksheet protection inside excel is very weak.

From J.E. McGimpsey's site:
http://www.mcgimpsey.com/excel/removepwords.html
 
Back
Top