View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ed from AZ Ed from AZ is offline
external usenet poster
 
Posts: 120
Default Input Box Vs Cancel

Change "FALSE" to "False" and it should work.

Ed

On Sep 5, 9:33 am, Ardy wrote:
Hello All:
I have a code that will give me a input box to add name to the list.

newName = Application.InputBox("Type new student name:", "Add
Student", "New Student", Type:=2)
If newName = "" Or newName = "FALSE" Then
Exit Sub
End If

My problem is that the input box has OK, Cancel and the X windows
default close option in top upper right corner. If I add a name and
press OK all is fine. However the cancel and close window option will
create a name called FALSE. How would I make it exit sub once those
to functions are pressed.

Regards
Ardy