Advice Please?

G

Greg

Hi all,

I have this code below it is working well apart from the inputboxes, I want
the person to have the ability to hit the cancel button. when this happens
now it fills the column "g" completely with yes
how can this be corrected.

Private Sub UserForm_Activate()
Sheet5.Activate
Label1.Caption = InputBox("WHAT IS THE PLAYER'S REGISTRATION NUMBER?",
"Existing Player's re-registration")

Dim Nor
Dim ans

On Error Resume Next

ans = Application.Match(CLng(Label1.Caption), Range("A:A"), 0)
If Not IsError(ans) Then
Label2.Caption = Application.Index(Range("B:B"), ans)
Label3.Caption = Application.Index(Range("c:c"), ans)
Application.Index(Range("j:j"), ans) = "YES"

Else
MsgBox "Invalid code"
End If
On Error GoTo 0
Nor = MsgBox("IS THIS THE RIGHT PERSON?", vbYesNo)

If Nor = vbNo Then
Label1.Caption = InputBox("WHAT IS THE PLAYER'S REGISTRATION NUMBER?",
"Existing Player's re-registration")

Exit Sub
End If

If Nor = vbYes Then
Unload Me
QUESTION1.Show
End If

End Sub

Thanks

greg
 
B

broro183

Hi Greg,
Thanks for the feedback, pleased I could help by passing on others
knowledge ;-)

Rob Brockett
NZ
Always learning & the best way to learn is to experience..
 

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

Similar Threads

Help with code please? 2
Adding two values 3
Help with code please 4
Please help with code? 2
Help with code please 4
Help on following code please? 2
Name look up 1
Help with code please 1

Top