ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Locking worksheets (https://www.excelbanter.com/excel-programming/386688-locking-worksheets.html)

slim4921

Locking worksheets
 
I am using Excel 2003 and would like to lock a worksheet, other than a check
box or button, such that the remainder of the sheet cannot be interacted with
(but can be viewed) until the check box or button has been clicked.

Any help greatly appreciated. Thanks

Vergel Adriano

Locking worksheets
 
Hi,

Maybe something like this would help. It will act as a toggle between being
protected and not. Add a button to the sheet and asign it to the macro
below.

Sub Button1_Click()
With ActiveSheet
If .ProtectContents = True Then
.Unprotect "password"
.EnableSelection = xlNoRestrictions
Else
.Protect "password"
.EnableSelection = xlNoSelection
End If
End With
End Sub

--
Hope that helps.

Vergel Adriano


"slim4921" wrote:

I am using Excel 2003 and would like to lock a worksheet, other than a check
box or button, such that the remainder of the sheet cannot be interacted with
(but can be viewed) until the check box or button has been clicked.

Any help greatly appreciated. Thanks



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

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