Although this question is being asked for 5 years ago. I just want to share my answer. Below is how I detect whether someone is clicked cancel and OK button in input box:
Public sName As String
Sub FillName()
sName = InputBox("Who is your name?")
' User is clicked cancel button
If StrPtr(sName) = False Then
MsgBox ("Please fill your name!")
Exit Sub
End If
' User is clicked OK button whether entering any data or without entering any datas
If sName = "" Then
' If sName string is empty
MsgBox ("Please fill your name!")
Else
' When sName string is filled
MsgBox ("Welcome " & sName & " and nice see you!")
End If
End Sub