Thread: [Solved] How to multiply numbers
View Single Post
 
Old 11-14-2017, 02:40 PM
macropod's Avatar
macropod macropod is online now 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 will need a macro for this. Try:
Code:
Sub Demo()
Dim Tbl As Table, r As Long, c As Long, Rslt, sMul As Single, Rng As Range
Rslt = InputBox("What is the multiplier?")
If IsNumeric(Rslt) = False Then Exit Sub
sMul = CSng(Rslt)
For Each Tbl In ActiveDocument.Tables
  With Tbl
    For r = 3 To .Rows.Count
      For c = 2 To .Columns.Count
        With .Cell(r, c)
          Set Rng = .Range
          Rslt = Split(Split(Rng.Text, vbCr)(0), " ")(0)
          If IsNumeric(Rslt) Then
            Rng.End = Rng.Start + Len(Rslt)
            Rng.Text = Rslt * sMul
          End If
        End With
      Next
    Next
  End With
Next
End Sub
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote