Hi, I'm trying to create an input box that will exit the sub if the user clicks on "cancel". Here is my current code, but it ends the sub when the user does not key in anything and clicks 'OK'.
Dim strInput As String
strInput = InputBox("Key in Item code")
If strInput = vbNullString Then
MsgBox ("Cancelled by User")
How do I improve it such that clicking "cancel" will exit the sub, yet clicking "ok" when the user had not keyed in anything will prompt a different message ("Please key in Item code")?
Thanks in advance!