title: #VALUE error in Excel 2010 RegExp
body: <p>I am trying to implement Regular Expressions in Excel 2010 on a mac, but with any formulas and data all I get is #VALUE errors</p>
  
  <p>Here is my implementation in a module:</p>
  
  <pre><code>Function RegExp1(ReplaceIn, ReplaceWhat As String, _
    ReplaceWith As String, Optional IgnoreCase As Boolean = False)
  
      Dim re As Object
      Set re = CreateObject("VBScript.RegExp")
      re.IgnoreCase = IgnoreCase
      re.Pattern = ReplaceWhat
      re.Global = True
  
      RegExp1 = re.Replace(ReplaceIn, ReplaceWith)
  End Function
  </code></pre>
  
  <p>And then in the cell I try:</p>
  
  <pre><code>=RegExp1(D2,"(PR2001\.)(\d)","$100$2")
  </code></pre>
  
  <p>All of this is executing on cells similar to:</p>
  
  <pre><code>PR2001.1
  PR2001.2
  PR2001.3
  </code></pre>
  
  <p>etc... I am trying to add zeros in between the last digit and period to format for easier sorting. Any help would be appreciated</p>