![]() |
#1
|
|||
|
|||
![]()
Insert Tables with Tags (while insert Table input box for rows and columns)
Sample file attached. |
#2
|
||||
|
||||
![]()
Your post lacks detail. It's impossible to know from what little you've posted how this might be automated.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
if 2row 2column table
first row & column with tag <2FG> last row with <LLA>(a) for first column and second column (b) if 4row 2column table and 6row 2column table first row & column with tag <4FG> second, fourth row with <MLA> (a, b, c, etc.) last low with <LLA> (a, b, c, etc.) |
#4
|
|||
|
|||
![]()
Can anyone help me on this i have lot of tables. Kindly help me.
|
#5
|
||||
|
||||
![]()
What you want to do can't be done via the Insert Table dialogue box. You would need a separate macro to populate the table after you've created it. Alternatively, you could use a macro to both create and populate the table. The following macro takes the latter approach
Code:
Sub AddTable() Application.ScreenUpdating = False Dim StrNum As String, NumRows As Long, oTbl As Table, r As Long StrNum = InputBox("How Many Pairs of Rows?") If IsNumeric(StrNum) = False Then Exit Sub NumRows = CLng(StrNum) * 2 Set oTbl = Selection.Tables.Add(Range:=Selection.Range, NumRows:=NumRows, NumColumns:=2) With oTbl .Borders.Enable = True With .Range.ParagraphFormat .SpaceBefore = 0 .SpaceAfter = 0 End With If NumRows = 2 Then .Cell(1, 1).Range.Text = "<2FG>" .Cell(1, 2).Range.Text = "<2FG>" .Cell(2, 1).Range.Text = "<LLA>(a)" .Cell(2, 2).Range.Text = "<LLA>(b)" Else For r = 1 To NumRows Step 2 .Cell(r, 1).Range.Text = "<4FG>" .Cell(r, 2).Range.Text = "<4FG>" .Cell(r + 1, 1).Range.Text = "<LLA>(" & Chr(96 + r) & ")" .Cell(r + 1, 2).Range.Text = "<LLA>(" & Chr(97 + r) & ")" Next End If End With Application.ScreenUpdating = True End Sub For Mac macro installation & usage instructions, see: Word:mac - Install a Macro.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
adding a table to a template, need the table to autosize or insert row if necessary | tcoia | Publisher | 0 | 03-24-2020 11:06 AM |
VBA coding to insert a word table using quickparts and insert table menu | Dont know | Word VBA | 3 | 02-12-2020 09:51 AM |
![]() |
ganning | Word Tables | 2 | 11-02-2017 12:17 PM |
Search and replace/insert HTML code into Master File using tags | dave8555 | Excel | 2 | 02-23-2014 03:51 PM |
Insert table in document - automatically updates second table in summary? | Mechanic | Word | 2 | 08-01-2012 09:44 PM |