View Single Post
  #2   Report Post  
Posted to microsoft.public.word.tables
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default How do I lock a table (no more rows at bottom)?

Melissa at boa wrote:
Hi, i'm using word 07 and need to prevent my last table row from
creating more rows when I tab. I have 3 small tables all on one page
and may need to merge these into one table.

1. How do I lock my bottom table row from adding more lines when I
try to tab to the next table.
2. If necessary, how do I merge two tables?

Thank you VERY much!


For question 1, you can install the following macro in the template for this
kind of document (see http://www.gmayor.com/installing_macro.htm if needed):

Sub NextCell()
Dim thisRow As Integer, thisCol As Integer
Dim thisTable As Table, iTbl As Table
Dim thisTableIdx As Long


Set thisTable = Selection.Tables(1)
thisTableIdx = ActiveDocument.Range(0, _
thisTable.Range.End).Tables.Count
thisRow = Selection.Information(wdEndOfRangeRowNumber)
thisCol = Selection.Information(wdEndOfRangeColumnNumber)

If Not ((thisRow = thisTable.Rows.Count) And _
(thisCol = thisTable.Columns.Count)) Then
Selection.MoveRight Unit:=wdCell
Else
If thisTableIdx ActiveDocument.Tables.Count Then
' there is another table to go to
ActiveDocument.Tables(thisTableIdx + 1).Cell(1, 1).Select
Selection.Collapse wdCollapseStart
End If
End If
End Sub

Note that normally (unless you're working in a protected form document and
there is a form field in the next table) you can't "tab to the next table".
The macro makes that possible.

For question 2, just delete the paragraph mark(s) between the tables to make
them into one table. This is easier to control if you can see the paragraph
marks; clicking the ¶ button switches them on and off.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.