Problem with macro for data carriage from Word to Excel

Ruski

New Member
Joined
Sep 28, 2018
Messages
1
Hey everyone,

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!!!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,214,954
Messages
6,122,462
Members
449,085
Latest member
ExcelError

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top