I'm unlocking a cell via vba on a protected sheet:
Code: Select all
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("H2:H23")) Is Nothing Then
Dim PW As String
PW = "myPassword"
On Error GoTo ProtectMe
With ActiveSheet
.Unprotect PW
.Cells(1, 1).Locked = False
.Cells(1, 1).Clear
.Cells(1, 1).Locked = True
ProtectMe:
ActiveSheet.Protect PW
End With
End If
End Sub
How do I clear the cell value so when it is dbl clicked the user see's only a cursor in the cell?
Cheers