View Single Post
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 407
Default rows in tables 2007

If you run a macro containing the following code, it will ask you how many
rows you want to add to the end of table in which the selection is located.

Dim i As Long
If Selection.Information(wdWithInTable) Then
For i = 1 To InputBox("Enter the number of rows that you want to add")
Selection.Tables(1).Rows.Add
Next i
Else
MsgBox "The selection must be inside the table to which you want to add
the rows."
End If

If you want them added before the row in which the selection is located, use

Dim i As Long
If Selection.Information(wdWithInTable) Then
For i = 1 To InputBox("Enter the number of rows that you want to add")
Selection.Tables(1).Rows.Add Selection.Rows(1)
Next i
Else
MsgBox "The selection must be inside the table to which you want to add
the rows."
End If


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Billj" wrote in message
...
How do I insert a specified number of rows in tables in word 2007 without
having to select the number of ros in the existing table ie 20 rows to the
end of a table