Application.DisplayAlerts

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

Guest

Hi:

The following does not stop the alert message box if
an attempt is made to enter data into a protected cell.
Any advice as to how to stop the alerts would be greatly
appreciated.

Private Sub Worksheet_Activate()
Worksheets("Sheet1").Unprotect
Application.DisplayAlerts = False
Worksheets("Sheet1").Protect
End Sub

Thanks
TK
 
TK, you cannot enter data into a proctected cell, locked cell,

By default all cells in excel are protected or locked, select the cells you
want to unlock and go to format, cells, protection and uncheck locked, the
go to tools, protection, and protect sheet, enter a password if you want,
now only the cells that you unlocked can be edited.

If you only need a few locked I would select them all first, Ctrl A, then
go to format, cells, protection and uncheck locked, then select the cells
you want to lock and go to format cells and check locked, the go to tools,
protection, and protect sheet, enter a password if you want, now the cells
that you locked can not be edited


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
Thanks Paul:

I probably was not clear. I’m familiar with the sheet
protecting procedure. I’m trying to stop the caution
alert if a user tries to inadvertently enter data into a
protected cell. Obviously, they cannot enter data I just
do not want them to be reminded that they cannot.

Thanks
TK
 
TK, I don't think you can cut off that alert, how about not letting them
select the locked cells? If you are using excel 2002 or newer when you
protect the sheet uncheck select locked cells, if you have an early version
you can use a macro like this in the thisworkbook module

Private Sub Workbook_Open()
'will not let you select locked cells
'This is a setting that excel doesn't remember between closings,so have
'your workbook_open code do it each time:
With Worksheets("sheet1") 'change to your sheet name
..Activate
..EnableSelection = xlUnlockedCells

'change password here
..Protect Password:="123", Contents:=True, UserInterfaceOnly:=True
End With
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 

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