View Single Post
 
Old 11-22-2024, 11:30 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oTbl As Table
Dim lngIndex As Long
  Set oTbl = Selection.Tables(1)
  oTbl.Columns.Add
  For lngIndex = 1 To oTbl.Rows.count
    oTbl.Cell(lngIndex, oTbl.Columns.count).Range.Text = lngIndex
  Next lngIndex
  oTbl.Sort False, oTbl.Columns.count, , wdSortOrderDescending
  oTbl.Columns(oTbl.Columns.count).Delete
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote