Thread: [Solved] Manipulating Data in Cells
View Single Post
 
Old 09-11-2017, 04:45 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could do the conversions with a macro like:
Code:
Sub ConvCurrency()
Application.ScreenUpdating = False
Dim Tbl As Table, r As Long, c As Long, xchg As Single, strVal As String
xchg = CSng(InputBox("Exchange Rate to Apply?", "ForEx Conversion", "1.00"))
If xchg <= 0 Then Exit Sub
For Each Tbl In ActiveDocument.Tables
  With Tbl
    c = .Columns.Count
    For r = 1 To .Rows.Count
      With .Cell(r, c).Range
        strVal = Split(.Text, vbCr)(0)
        If IsNumeric(strVal) Then
          .Text = Format(CSng(strVal) * xchg, ",0.00")
        Else
          .Text = "USD"
        End If
      End With
    Next
  End With
Next
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote