ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Locked cell without alert (https://www.excelbanter.com/excel-programming/335047-locked-cell-without-alert.html)

milly

Locked cell without alert
 
Hi all!
I have locked a range of cells by vba and I'd like that when the user tries
to edit them, the alert messagebox with the edit-password textbox DOESN't
appear...
Is it possible?
thanks!

jjk

Locked cell without alert
 
I use a workaround where I dont allow the users to select the locked
cells.
This can be enabled while protecting the worksheet using the menu.
or programtically
sheet1.EnableSelection = xlUnlockedCells
sheet1.Protect

Hope it helps.
Regards,
Jayant


milly

Locked cell without alert
 
thanks but I have some cells not a sheet to lock...so...when the user want to
edit, I want that NO message appears...

"jjk" wrote:

I use a workaround where I dont allow the users to select the locked
cells.
This can be enabled while protecting the worksheet using the menu.
or programtically
sheet1.EnableSelection = xlUnlockedCells
sheet1.Protect

Hope it helps.
Regards,
Jayant



ben

Locked cell without alert
 
locking the cells without protecting the worksheet does no good anyway. The
solution he suggested means users can not even actually select locked cells,
so they will never recieve a message.
Ben

--
When you lose your mind, you free your life.


"milly" wrote:

thanks but I have some cells not a sheet to lock...so...when the user want to
edit, I want that NO message appears...

"jjk" wrote:

I use a workaround where I dont allow the users to select the locked
cells.
This can be enabled while protecting the worksheet using the menu.
or programtically
sheet1.EnableSelection = xlUnlockedCells
sheet1.Protect

Hope it helps.
Regards,
Jayant



STEVE BELL

Locked cell without alert
 
Below is code that I found in this ng.
It does even more that protect the sheets, it also prevents the
user from selecting protected cells.

Select UnProtected Cells ONLY
This will prevent users from clicking on protected cells on all
worksheets. Therefore, the warning message will not appear. The code
must be enterred in the ThisWorkbook module.

Note that the EnableSelection property must be reset each time the
workbook is opened as it defaults to xlNoRestrictions. The
worksheet(s)
must first be unprotected to set the EnableSelection property and then
must be protected for it to take effect.

Private Sub Workbook_Open()
Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
WS.Unprotect 'Password:="wxyz"
WS.EnableSelection = xlUnlockedCells
WS.Protect 'Password:="wxyz", UserInterfaceOnly:=True
Next
End Sub

Regards,
Greg Wilson 5/3/03


--
steveB

Remove "AYN" from email to respond
"milly" wrote in message
...
Hi all!
I have locked a range of cells by vba and I'd like that when the user
tries
to edit them, the alert messagebox with the edit-password textbox DOESN't
appear...
Is it possible?
thanks!





All times are GMT +1. The time now is 07:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com