View Single Post
 
Old 11-25-2024, 01:40 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
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

Here's an even more efficient version of Greg's macro - with error checking:
Code:
Sub TblSort()
Application.ScreenUpdating = False
Dim r As Long, c As Long
With Selection
  If .Information(wdWithInTable) = False Then Exit Sub
  With .Tables(1)
    .Columns.Add
    c = .Columns.Count
    For r = 1 To .Rows.Count
      .Cell(r, c).Range.Text = r
    Next
    .Sort False, c, , wdSortOrderDescending
    .Columns(c).Delete
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote