Thread: password ckeck
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
excelent excelent is offline
external usenet poster
 
Posts: 695
Default password ckeck

Maby this can give u a hint:

Private Sub TextBox2_AfterUpdate()
On Error GoTo wrongName
x = Sheets("Ark1").Range("A1:A100").Find(TextBox1.Valu e,
LookIn:=xlValues).Address
If Range(x).Offset(0, 1) = Val(TextBox2.Value) Then
MsgBox ("Ok password"): TextBox1 = "": TextBox2 = ""
Else
MsgBox ("Not Ok password"): TextBox2 = ""
End If
Exit Sub
wrongName:
MsgBox ("Not a valid name")
TextBox1 = "": TextBox2 = ""
End Sub



"Steve" skrev:

Hi all,

my question is,

in sheet("data")
I have a list of names in column A and 9 digit numbers in column B

How would i get a userform to check the name and numbers entered in
this page, i have tried Vlookup, but am getting an error message,

any help on the code would be appreciated!

basically i am using a userform with 2 x textbox's

Textbox1 is for username and Textbox2 is for the 9 digit number

i have been able to get the OK button to enable only when 9 digits
have been entered into textbox2 but getting it to check the data in
the sheet("data") is where i have the problem


HYCH


Steve