Password in a macro

G

Guest

I have a macro which requests a password before allowing one to change a
worksheet. I do not want the password to be case sensitive. My code follows:

On error GoTo Error
If TextBox1.Text <> "groupproject" Then
Unload UserFormPassword

GoTo Error
Exit Sub
Else Unload Password_UserForm
New_Or_Edit.Show

End If
Exit Sub
Error:

Unload Password_UserForm
Invalid_Password.Show


What can be done to make this NOT case sensitive?
 
G

Guest

Use the UCase (or LCase) function to check the Upper case value of what was
entered against the Upper case value of the password. Make sure to UCase both
sides (the entry and the password).
 
P

Patrick Simonds

Thanks!

Could not get that to work the way I wanted, but came up with this:

With TextBox1
.Value = LCase(.Value)
End With

Placed at the beginning of my code, it did the job.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top