View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
cory cory is offline
external usenet poster
 
Posts: 54
Default End Sub if InputBox cancelled (False)

I think that when you cancel an input box, a zero length string is returned.
As such, replace this:

If x = False Then

with this:

If x = "" Then

-Cory


"Francis Hookham" wrote:

Input Box Cancel button should stop the subroutine.



OK button tests to see if 'x' has been changed.



I cannot see what is wrong he



LastUsedRow = Sheets("Pages").Cells(Rows.Count, 5).End(xlUp).Row

DoorNum = Cells(LastUsedRow, 5)

x = InputBox("Door number?", _

"Additional items to door", DoorNum, 1)

If x = False Then

End

ElseIf x < DoorNum Then

DoorNum = x

End If



Francis Hookham