title: How to find whether value is integer
body: <p>I want to perform some task based on some ifs</p>
  
  <p>my (uncomplete) code is</p>
  
  <pre><code>Sub checkif()
      Dim s
      With ActiveDocument.Range
          s = Val(ActiveDocument.Paragraphs.Count)
          s = s / 5
              If s = Integer then
                  perform some task
              Else
                  Exit Sub
              End If
       End With
  End Sub
  </code></pre>
  
  <p>I am completely new to VBA and there are so many answers. I have tried several.
  one is</p>
  
  <pre><code>Sub checkif2()
      Dim s
      With ActiveDocument.Range
          s = Val(ActiveDocument.Paragraphs.Count)
          s = s / 5
              If IsNumeric(s) Then
              MsgBox "is integer"
              Else
              MsgBox "not integer"
                  Exit Sub
              End If
      End With
  End Sub
  </code></pre>
  
  <p>This always give integer.</p>
  
  <p>checked another one</p>
  
  <pre><code>Sub checkif2()
      Dim s
      With ActiveDocument.Range
          s = Val(ActiveDocument.Paragraphs.Count)
          s = s / 5
              If TypeName(s) = "Integer" Then
              MsgBox "is integer"
              Else
              MsgBox "not integer"
                  Exit Sub
              End If
      End With
  End Sub
  </code></pre>
  
  <p>Always give not integer.
  Is there any method for Word VBA?</p>