Hey everyone,
I use this macro for migrating data (monetary units) from MS Word to MS Excel but, unfortunately, this macro rounds prices to the whole number
For instance, 81 683.91$ from MS Word transfers as 81683,00 in MS Excel. What I need is exactly, penny for penny conversion
Thank you in advance and pardon my poor English!!!
Code:
<code>Sub Word2Excel()
Dim z, x As Object
With CreateObject("VBScript.RegExp")
.Global = True
.Pattern = "[^\d]|..$"
For Each x In Selection.Cells
If Not x.HasFormula Then
If Not IsDate(x.Value) Then
If Not IsNumeric(x.Value) Then
z = x.Value: z = .Replace(z, "")
x.Value = z
End If
End If
End If
Next
End With
End Sub</code>
I use this macro for migrating data (monetary units) from MS Word to MS Excel but, unfortunately, this macro rounds prices to the whole number
For instance, 81 683.91$ from MS Word transfers as 81683,00 in MS Excel. What I need is exactly, penny for penny conversion
Thank you in advance and pardon my poor English!!!