View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ardy Ardy is offline
external usenet poster
 
Posts: 136
Default Input Box Vs Cancel

On Sep 5, 10:31 am, Ed from AZ wrote:
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

Ed:
Great, So Simple..... Could you explain a bit what is the difference
between the two.