marreco7
Technical User
- Jan 4, 2012
- 3
Hi..
Can anyone help me to enter the code below a mask inputbox password in the code that follows below .. thank you!
Can anyone help me to enter the code below a mask inputbox password in the code that follows below .. thank you!
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewValue As Variant, OldValue As Variant
If Target.Count > 1 Then Exit Sub
'Say you want to work with the range A1:F100
If Not Intersect(Target, Range("A1:F10")) Is Nothing Then
NewValue = Target.Value
Application.EnableEvents = False
Application.Undo
OldValue = Target.Value
If OldValue = "" Then
Target.Value = NewValue
ElseIf InputBox("Caso tenha premissão entre com a senha", "Acesso restrito") = "ale" Then
Target.Value = NewValue
Else: MsgBox "Entrada indevida, você não pode alterar o conteudo da celula.", 16, "Células Bloqueadas"
Target.Value = OldValue
End If
Application.EnableEvents = True
End If
End Sub