Good grief, thanks a lot Paul!! Are all the experts playing in this forum?
I have a minor problem, when I run the macro, the results are a little bit out... what do you think I can do to fix this? Results below... omar
BEFORE
alpha bravo charlie
delta echo foxtrot
golf hotel india
juliet kilo lima
mike november oscar
papa quebec romeo
sierra tango uniform
victor whiskey xray
yankee zulu
AFTER
yankee zulu
golf hotel india
juliet kilo lima
papa quebec romeo
delta echo foxtrot
alpha bravo charlie
mike november oscar
victor whiskey xray
sierra tango uniform
Quote:
Originally Posted by macropod
You could run a macro like the following against a selection of paragraphs:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Tbl As Table, i As Long
With Selection
Set Tbl = .Range.ConvertToTable
With Tbl
.Columns.Add
For i = 1 To .Rows.Count
.Cell(i, 2).Range.Text = Len(.Cell(i, 1).Range.Text)
Next
.Sort ExcludeHeader:=False, FieldNumber:=2
.Columns(2).Delete
.ConvertToText
End With
End With
Application.ScreenUpdating = True
End Sub
|