kann mir bitte jemand sagen was mache ich falsch:
Ich habe
userform---frmPasswort
textfeld---txtpasswort
button-----bpassword
Der Button habe ich so programmiert
Private Sub bPasswort_Click()
Unload FrmPasswort
Range("F14").Select
End Sub
Option Explicit
Sub schutzweg()
Dim ws As Worksheet
Dim pw, pass As String
FrmPasswort.Show
pw = FrmPasswort.txtPasswort.Text
pass = "faby"
If pw = pass Then
For Each ws In Worksheets
ws.Unprotect Password:=pw
Next ws
Else
MsgBox ("Sorry,falsche Passwort")
End If
End Sub
Ich bekomme immer Sorry, falsche Passwort obwohl ich die richtige eingebe.
Hilfe
Danke
Faby