Stopping auto row in table

D

Doug Robbins

If you have the following macro in the normal.dot template or an add-in, it
will stop a row being added when the tab key is pressed in the last cell in
the table:

Sub NextCell()
'
' NextCell Macro
' Moves to the next table cell unless the selection is in the last cell of
the table
'
Dim i As Long, j As Long
If Selection.Information(wdEndOfRangeRowNumber) <
Selection.Tables(1).Rows.Count Or
Selection.Information(wdEndOfRangeColumnNumber) <
Selection.Tables(1).Columns.Count Then
Selection.MoveRight Unit:=wdCell
Else
Exit Sub
End If

End Sub


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top