![]() |
#7
|
|||
|
|||
![]() Code:
Sub Insert_R_C_into_every_cell() ndx = 1 For Each aTable In ActiveDocument.Tables ' no. of rows and columns in each table Rows = aTable.Rows.Count Cols = aTable.Columns.Count Dim rng As Range ' insert each cell value into the master table For r = 1 To Rows For c = 1 To Cols ' insert a cell ID into every cell cellvalue = "Cell_ID[" & r & ", " & c & "]" ActiveDocument.Tables(ndx).Cell(r, c).Range.InsertAfter cellvalue ActiveDocument.Tables(ndx).Cell(r, c).Range.Font.Hidden = True Next Next Exit For ndx = ndx + 1 Next aTable End Sub |
Tags |
vba, vba word, word table |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
allenglishboy | Word | 1 | 11-06-2012 05:48 PM |
![]() |
Angel9520 | Word Tables | 1 | 05-02-2012 01:00 AM |
![]() |
christie | Word | 1 | 08-17-2011 09:10 AM |
inserting a string of data into an MS Word table??? | matto | Word VBA | 0 | 07-16-2010 09:35 AM |
Programmatically get File Path for currently opened WORD document | franferns | Word | 1 | 11-26-2009 12:36 PM |