Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-21-2023, 11:15 PM
gmayor's Avatar
gmayor gmayor is offline Executing macro on each subsequent page/table Windows 10 Executing macro on each subsequent page/table Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Greg's code operates on the selected table. Change it to sequentially process all the tables e.g.
Code:
Sub SortTable()
  'Set the table object = the table with the selection
  On Error GoTo Err_Handler:
  For Each m_Otbl In ActiveDocument.Tables
    'Table must be uniform (not split or merged cells)
    If Not m_Otbl.Uniform Then
        MsgBox "The selected table has split or merge cells and cannot be sorted with this procedure", vbInformation + vbOKOnly, "Non-Uniform Table"
        Exit Sub
    End If
    TableSort_Re_Sort
  Next m_Otbl
  Exit Sub
Err_Handler:
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Page No 1 changes when subsequent Page No formatted as continuous brigb Word 3 06-28-2023 12:35 PM
Executing macro on each subsequent page/table Menu Macro Not Executing - Need Help Moondoggy Excel 4 01-14-2023 12:49 AM
Executing macro on each subsequent page/table Table Header - have 'continued' on subsequent pages... User12344321 Word Tables 6 07-27-2020 12:45 PM
Executing a Word macro only after a certain date & time rdross51 Word VBA 4 07-07-2017 06:29 AM
Executing macro on each subsequent page/table Shift Excel Cell after executing a macro for second time LearningMacro Excel Programming 2 01-08-2015 03:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:57 PM.


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