Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-17-2015, 03:57 AM
gmayor's Avatar
gmayor gmayor is offline Dynamic table numbers Windows 7 64bit Dynamic table numbers Office 2010 32bit
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

Provided the tables are in the body of the document and not in headers footers, text boxes etc, and are similar to that shown, then the following should work.

Code:
Sub NumberTables()
Dim oTable As Table
Dim i As Long, j As Long
Dim oCell As Range
    i = 1
    For Each oTable In ActiveDocument.Tables
        For j = 2 To oTable.Rows.Count
            Set oCell = oTable.Cell(j, 1).Range
            oCell.End = oCell.End - 1
            oCell.Text = i & Chr(46) 'This is what goes in the cells!
            i = i + 1
        Next j
    Next oTable
lbl_Exit:
    Set oTable = Nothing
    Exit Sub
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
Dynamic Mail Merged Table hanskimber Mail Merge 2 04-24-2015 11:21 PM
Dynamic table numbers Add content to Dynamic/Automatic Table of Contents rosenina18 Word 3 04-14-2015 05:15 AM
Dynamic Pivot Table in 2013 Alaska1 Excel 0 01-29-2015 10:33 AM
Dynamic table numbers Mail Merge Into Dynamic Table Jag618 Mail Merge 1 03-04-2013 11:26 PM
Dynamic table numbers VBA: Include Dynamic Sheet Name In Pivot Table Source Data ibrahimaa Excel Programming 2 04-28-2012 12:27 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:40 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