View Single Post
  #3   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)?

On Wed, 4 Nov 2009 06:36:01 -0800, Melissa at boa Melissa at
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 the first question, you can't "lock" the table row, but you can
install this macro in your template (see
http://www.gmayor.com/installing_macro.htm if needed) to change the
behavior of the tab key when the cursor is in the last cell of a
table:

Sub NextCell()
Dim oTbl As Table
Dim tblIndex As Long
Dim thisRow As Long, thisCol As Long

Set oTbl = Selection.Tables(1)
tblIndex = ActiveDocument.Range(0, oTbl.Range.End).Tables.Count

thisRow = Selection.Information(wdEndOfRangeRowNumber)
thisCol = Selection.Information(wdEndOfRangeColumnNumber)

If Not ((thisRow = oTbl.Rows.Count) And _
(thisCol = oTbl.Columns.Count)) Then
Selection.MoveRight Unit:=wdCell, Count:=1
Else
' If this isn't the last table, jump to the next table
If tblIndex ActiveDocument.Tables.Count Then
ActiveDocument.Tables(tblIndex + 1).Cell(1, 1).Select
Selection.Collapse wdCollapseStart
End If
End If
End Sub

The other thing is that normally you can't "tab to the next table"
unless you have a protected form with form fields in the table cells.
But the above macro will take care of that, too.

For your second question, just delete any text and paragraph marks
from between the two tables to merge them. This is easier to do if you
can see the paragraph marks, so click the ¶ button to turn 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.