password userform

K

K1KKKA

Sub Sunselect()
Dim PassStr As String
PassStr = InputBox("Enter Password Please", "My Password
Prompt")

If PassStr = "Manager" Then
Sheets("Sun").Select
Range("A11").Select
Else
MsgBox "Wrong Password Entered"
End If


End Sub


Have created the userform for the above task, but not having much luck
with the code for this

Any help would be appreciated
 
J

John Bundy

A few small errors, and when selecting a range on a worksheet other than
current, it wants you to give sheet name as well. Also be aware that as is
your password is case sensitive.
Sub Sunselect()
Dim PassStr As String

PassStr = InputBox("Enter Password Please", "My Password Prompt
")

If PassStr = "Manager" Then
Sheets("Sun").Select
Sheets("Sun").Range("A11").Select
Else
MsgBox "Wrong Password Entered"
End If


End Sub
 
D

Dave Peterson

See any of your other posts for more replies.
Sub Sunselect()
Dim PassStr As String
PassStr = InputBox("Enter Password Please", "My Password
Prompt")

If PassStr = "Manager" Then
Sheets("Sun").Select
Range("A11").Select
Else
MsgBox "Wrong Password Entered"
End If

End Sub

Have created the userform for the above task, but not having much luck
with the code for this

Any help would be appreciated
 

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