From MSDN:
When both helpfile and context are supplied, a Help button is
automatically added to the dialog box.
If the user clicks OK or presses ENTER, the InputBox function returns
whatever is in the text box. If the user clicks Cancel, the function
returns a zero-length string ("").
The bold part above is not exactly true.
A user can cancel an InputBox dialog in many ways; by closing dialog, clicking Cancel, or pressing ESC, ALT + F4, and so on. In all cases except pressing ⏎ or clicking OK InputBox returns Empty
(an uninitalized variant, its value is 0 for numeric, zero-length string ("") for string implicitly) and it means the dialog dismissed.
Since there's an implicit conversion between a zero-length string ("") and Empty
variables, looking for zero-length string equality as MSDN suggested is not always an appropriate solution(e.g. in a logic where zero-length string means "use default", not cancelled).
Dim retval
retval = InputBox("txt")
If IsEmpty(retval) Then
'cancelled
MsgBox "operation has been cancelled"
Else
'something has entered even zero-length
MsgBox retVal
End If