Quote:
Originally Posted by Ulodesk
May I ask, what does the "Position:=InchesToPoints(1.41), " instruct?
|
It sets the position of the decimal tab in the cell, however on returning to the question, I note that the column widths may be variable, in which case the following may work better.
Code:
Sub Macro1()
Dim oTable As Table
Dim i As Integer
Dim oCell As Cell
Dim oRng As Range
Dim iPos As Integer
Set oTable = Selection.Tables(1)
With oTable
For i = 2 To .Rows.Count
For Each oCell In .Rows(i).Cells
iPos = oCell.Width - oCell.LeftPadding - oCell.RightPadding - 20
Set oRng = oCell.Range
oRng.Collapse 1
oRng.MoveEndWhile Chr(32)
oRng.Text = ""
oCell.Range.ParagraphFormat.TabStops.Add _
Position:=iPos, _
Alignment:=wdAlignTabDecimal, _
Leader:=wdTabLeaderSpaces
Next oCell
Next i
End With
Set oTable = Nothing
Set oCell = Nothing
Set oRng = Nothing
End Sub