Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 11-22-2024, 11:30 AM
gmaxey gmaxey is offline VBA/Macro to reverse order table lines Windows 10 VBA/Macro to reverse order table lines Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
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
 

Tags
order of tables, reversing order



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA/Macro to reverse order table lines Print two pages per page but in reverse order hammad Word 10 06-20-2019 09:01 AM
reverse order of paragraphs, word 2010 moorea21 Word VBA 1 08-02-2018 03:47 AM
VBA/Macro to reverse order table lines Is There an Animation that Will Reverse the Order of a Bulleted List equity PowerPoint 3 04-04-2014 12:33 AM
VBA/Macro to reverse order table lines Reverse Order for Flashcards? bknollman3 PowerPoint 2 03-23-2013 06:34 AM
Reverse order of headings throughout Word my_vine_figtree Word VBA 1 08-17-2010 01:46 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft