View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Greg[_27_] Greg[_27_] is offline
external usenet poster
 
Posts: 50
Default Help on following code please?

MyInput = InputBox("ENTER THE PLAYERS REGISTRATION #")

Hi all I am wondering how to change the code on this input box it does what
I want but if the person hits the cancel button or the x button i need it to
go to a userform called "main"
How do I do this?

here is the full code

Private Sub UserForm_Activate()
Application.Wait Now + TimeValue("00:00:2")
Dim MyInput
Dim A
Sheet2.Activate

On Error Resume Next

MyInput = InputBox("ENTER THE PLAYERS REGISTRATION #")
A = Application.Match(CLng(MyInput), Range("A:A"), 0)
Label1.Caption = Application.Index(Range("B:B"), A)
INDSCORE.Caption = " THE PLAYER YOU HAVE SELECTED IS " &
Label1.Caption & " REGISTRATION NUMBER " & MyInput & ", IS THIS THE CORRECT
PLAYER?"
If Not IsError(A) Then
Else
MsgBox "PLEASE CHECK THE REGISTRATION NUMBER"
Unload Me
INDSCORE.Show

End If
On Error GoTo 0

End Sub

Thanks Greg