End of row in table

F

Fred Kruger

can anyone tell me how using VBA I move the cursor out of the end of a row
so i can hit return to insert another exact row, form any column within the
row.

I can do it using a loop which locates the column number and then moves the
cursor each column at a time until it is outside the table but I want to do
it easier if there is a easier way.

Cheers Fred
 
H

Helmut Weber

Hi Fred,
you don't have to move the cursor at all.
Have a look at:

Selection.InsertRowsBelow 1

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
J

Jeff

I don't understand your explanation of the problem but this will insert a
new row in a table

With Selection
If .Information(wdWithInTable) Then
.Tables(1).Rows.Last.Select
.InsertRowsBelow 1
End If
End With
 
F

Fred Kruger

I am sorry these dont seem to work I forgot to say I am using word 97 and
not xP but i will look to see if there is an equivalent.

Fred
 
J

Jeff

My memory of Word97 macros is a bit rusty but I think you can use this to
add a row to the end of a table

With Selection
If .Information(wdWithInTable) Then
With .Tables(1).Range
ActiveDocument.Range(Start:=.End - 1, End:=.End - 1).Select
End With
.InsertRows 1
End If
End With

Jeff
 

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