Automatically insert new row

C

Céline

I have a Word document with several tables. To move I use
the tab, but when I am in last the cells of the first
table and I want to go to the next table, Word insert
automatically a new row, how can I make so that it does
not do it. Thank you
 
J

Jean-Guy Marcil

HI Céline,

Well, don't use the Tab key when in the last cell of the last row! ;-)

Unless you are in a protected forms with formfields, you cannot
"automatically" jump from the end of one table to the beginning of the next
table, at least, I do not know of any way of doing that, except via macros
(this would involve writing code and creating a keyboard shortcut plus
creating a global template to hold all of that code...is it worth the effort
in your case?)

Why can't you just scroll down to the next table and click in it?

--
Cheers!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
K

Klaus Linke

Céline, it does sound like you might try a form, but...
any way of doing that, except via macros (this would involve
writing code and creating a keyboard shortcut plus creating a
global template to hold all of that code...is it worth the effort
in your case?)

I've written the code if you want to try it.
No need to set up a keyboard shortcut (because it replaces the built-in
command "NextCell").
Just put it in your Normal.dot. In case you need help with that:
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm
If you don't want to use the macro any more, change the macro's name, or
delete it.

Greetings,
Klaus


Sub NextCell()
Dim rngCell As Range
Dim iTable As Long
Set rngCell = _
ActiveDocument.Range( _
Selection.Tables(1).Range.End - 2, _
Selection.Tables(1).Range.End - 2)
rngCell.Expand Unit:=wdCell
If Selection.Cells.Count > 1 Then
Selection.Collapse (wdCollapseStart)
Else
Selection.Collapse (wdCollapseStart)
If Selection.start = rngCell.start Then
iTable = ActiveDocument.Range(0, _
Selection.Range.start).Tables.Count
If ActiveDocument.Tables.Count > _
iTable Then
rngCell.start = _
ActiveDocument.Tables(iTable + 1).Range.start
rngCell.End = rngCell.start
rngCell.Expand Unit:=wdCell
rngCell.Select
Else
rngCell.start = _
ActiveDocument.Tables(1).Range.start
rngCell.End = rngCell.start
rngCell.Expand Unit:=wdCell
rngCell.Select
End If
Else
WordBasic.NextCell
End If
End If
End Sub
 

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