Vlož do modulu listu, kde chceš mít tu zamknutou buňku.
Platí pro E10 a heslo "heslo", změň dle sebe.
Dim pwd As String
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("E10").Address Then
If Not pwd = "heslo" Then
With Application
.EnableEvents = False
.Undo
.EnableEvents = True
MsgBox "neplatne heslo"
End With
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("E10").Address Then
pwd = InputBox("Zadej heslo", "Password", "password")
If Not pwd = "heslo" Then
MsgBox "Neplatne heslo"
End If
End If
End Sub
citovat
Platí pro E10 a heslo "heslo", změň dle sebe.
Dim pwd As String
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("E10").Address Then
If Not pwd = "heslo" Then
With Application
.EnableEvents = False
.Undo
.EnableEvents = True
MsgBox "neplatne heslo"
End With
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("E10").Address Then
pwd = InputBox("Zadej heslo", "Password", "password")
If Not pwd = "heslo" Then
MsgBox "Neplatne heslo"
End If
End If
End Sub
citovat