title: VBA Check if a decimal value has only 2 decimal points. Error using Int()
body: <p>I'm using vba to write some check routines on a Excel file. One of them need to check if the values of some cells have only 2 or less decimal points. To do that, i write a function that basically have this code:</p>
  
  <pre><code>Function checkValues(sheet as Worksheet) as Boolean
      val = sheet.Cells(1,1).Value
      val = val * 100
      valInt = Int(val)
  
      if valInt &lt;&gt; val then
          checkValues = false
          Exit Function
      end if
      checkValues = true
  End Function
  </code></pre>
  
  <p>The problem is that when i put the value of the Cell(1,1) equal to 1,12 this function returns False. When i use the Debug i see clearly that both valInt and val are equal to 112, but i don't know why the statement 'valInt &lt;> val' gives me 'True'.</p>
  
  <p>Anybody can help me?</p>
  
  <p>ps: i already try to change to Fix() function and try a lot of others statements.</p>
  
  <p>Thanks very much.</p>