Ifs and Buts

Gastank

New Member
Joined
Feb 17, 2002
Messages
34
I'm trying to extend the number of users (with passwords) on a simple Userform but I can't work it out.
My code is:-

Private Sub OK_Click()

If UCase(TextBox1.Text) <> "BOND" Or UCase(TextBox2.Text) <> "SECRET" Then
MsgBox "Please enter the correct user name and password"
TextBox1.Text = ""
TextBox2.Text = ""
Me.TextBox1.SetFocus
Else
Range("User").Value = TextBox1.Text
Range("Password").Value = TextBox2.Text

Unload Me
End If
End Sub
How can I set up addiitonal User/passwords?
The login subsequently sets up a Page Parameter on Pivot Table.

As always any help would be greatly appreciated
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,214,614
Messages
6,120,530
Members
448,969
Latest member
mirek8991

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top