richiwatts
Technical User
I created a very basic Macro to add a row at the bottom of a table in MS Word:
Sub Newissue()
Selection.InsertRowsBelow 1
End Sub
However, this will only work if the curser is in the last row of the table. So if I just open the document and run the Macro I get a run time error because the curser is not in the table anywhere. If I put the curser in one of the rows that is not the last row I end up with a row being inserted in the wrong place.
How can I be sure that on running a Macro that a row will be inserted at the end of the table without having to place the curser in the last row?
Many thanks
Richi
Sub Newissue()
Selection.InsertRowsBelow 1
End Sub
However, this will only work if the curser is in the last row of the table. So if I just open the document and run the Macro I get a run time error because the curser is not in the table anywhere. If I put the curser in one of the rows that is not the last row I end up with a row being inserted in the wrong place.
How can I be sure that on running a Macro that a row will be inserted at the end of the table without having to place the curser in the last row?
Many thanks
Richi