title: MsgBox+InputBox with Numbers,verify input number with If
body: <p>Newbie alert. I'm using a <code>MsgBox</code> and an <code>InputBox</code> combination which asks a user whether they want to delete a row (msgbox) with a specified value (inputbox). I am looping it until I get a <code>vbNo</code> in the <code>Msgbox</code>, which seems to work, however the InputBox user value validation does not seem to work. 
  <br/>I've read that Inputboxes recognise values as String, so not sure if this could be an issue?</p>
  
  <p>My queries</p>
  
  <p>1) I want to limit users to enter Numbers only into the input box, which are also no longer than 4 digits. I'm using the If statements for this, but none work. I was thinking of assigning an Inputbox Type to Integer, and it limits input to numbers, but there is no warning if user mistypes and not all will know what they're doing wrong.</p>
  
  <p>2) When I put the line <code>If UserValue = vbNullString Then GoTo Continue</code> which is the opposite to <code>If UserValue &lt;&gt; vbNullString Then GoTo StoreEntered</code> - the procedure doesn't work, is there a difference? Any suggestions much appreciated.</p>
  
  <p>3) <strong>UPD</strong> I've just tried clicking <code>vbYes on Mgsbox</code> and then <code>Cancel on InputBox</code> and I swear it worked before, but doesn't seem to work anymore. I would have thought that referencing to the <code>vbNullString</code> would solve the issue of not entering anything and clicking OK or simply Cancelling the inputBox.</p>
  
  <p>Here is my code</p>
  
  <pre><code>Dim UserValue As Integer
  Dim UserReply As Variant
  
  KeepLoop:
  Do
  UserReply = MsgBox(Prompt:="Do you want any store transactions removed?", Buttons:=vbYesNo, Title:="Stores removed")
      If UserReply = vbNo Then GoTo Continue
      If UserReply = vbYes Then GoTo UserInputReqd
  Loop Until UserReply = vbNo
  
  UserInputReqd:
  UserValue = Application.InputBox(Prompt:="Enter any store number you want removed from the file. Otherwise click Cancel", _
                  Title:="CHOSE STORES TO RUN OR DELETE") ', Type:=1)
  
          If UserValue &lt;&gt; vbNullString Then GoTo StoreEntered 'If user left line blank and clicked 'Ok' or clicked 'Cancel'
          If Not IsNumeric(UserValue) Then
                  MsgBox "You must enter a numeric value"
          If Len(UserValue) &gt; 4 Then
                  MsgBox "Max store number is 4 digits", vbCritical
          End If
          End If
  
  StoreEntered:
  r = 100000
  Do
  If Sheets(csv_sht).Cells(r, 1) = UserValue Then Sheets(csv_sht).Rows(r).EntireRow.Delete
  r = r - 1
  Loop Until r = 1
  GoTo KeepLoop
  
  Continue: 'Next step, continue as normal.
  ==Code here==
  
  End Sub
  </code></pre>