View Single Post
  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Opinicus[_2_] Opinicus[_2_] is offline
external usenet poster
 
Posts: 97
Default change decimal dots per coma (in word)

On Mon, 3 May 2010 15:23:01 -0700, Gabriela
wrote:

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

--
Bob
http://www.kanyak.com