Having a table with numbers in word, how can I change decimal dots per coma?
In addition to what Doug said I should add something else because I
frequently have this problem too. I often have a lot of numbers in
tables with the "European" format like this:
321.576,98
That is, "." separates the thousands and "," separates the decimal
fraction. I need to change these numbers to "English" format like
this:
321,576.98
The way to do this is first find and replace all of the "." to another
character that doesn't exist in the table, say "|". Next find and
replace all of the "," to ".". Finally find and replace all of the "|"
to ",".
The following is a macro that I've been using to do this for many
years:
<begin macro>
Sub ToggleCommasAndPeriods()
'
' ChangeFormatOfSelectedNumber Macro
' Macro created 24-Mar-05 by Greg Maxey <
[email protected]>
'
Dim myRange As Range
If Selection.Type = wdSelectionIP Then
MsgBox "Select text before running this macro.", , "Nothing
Selected"
End
End If
Set myRange = Selection.Range
myRange = Replace(myRange, ".", "..")
myRange = Replace(myRange, ",", ",,")
myRange = Replace(myRange, ",,", ".")
myRange = Replace(myRange, "..", ",")
With myRange
If Left(.Text, 1) = "-" Then
.Text = "(" & Replace(.Text, "-", "") & ") "
End If
End With
End Sub
</end macro>
I can't comment on it at all except to say that it works as
advertised.
HTH