title: Comparing version numbers with more than one decimal point in Excel VBA
body: <p>I have a Worksheet that stores a software version number in a cell and it uses multiple decimal points. e.g. 5.2.16</p>
  
  <p>I need to be able to do version number comparisons. Is the version number in the cell higher or lower than the version number I'm comparing it to.</p>
  
  <p>A Double can only store a number with a single decimal point, so that was out.</p>
  
  <p>One method I've tried is to remove the decimals with Replace and store the number in a Long variable.</p>
  
  <pre><code>lngMyNumber = Replace("5.2.16", ".", "")
  </code></pre>
  
  <p>I can then easily compare as numbers but of course if the version number 5.1 (51) was compared to 4.5.10 (4510), 5.1 would not come out as the higher version number.</p>
  
  <p>Has anyone got a suggestion for an elegant solution?</p>