Is there a way to write vba code to insert rows in a table up to the bottom of the current page. Thank you
Printable View
Is there a way to write vba code to insert rows in a table up to the bottom of the current page. Thank you
Code:Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oTbl As Table
Dim oRng As Range
Set oTbl = Selection.Tables(1)
Set oRng = oTbl.Range
oRng.Collapse wdCollapseEnd
oRng.Move wdParagraph, 1
Do
oTbl.Rows.Add
Loop While oTbl.Rows.Last.Range.Information(wdActiveEndAdjustedPageNumber) = oRng.Information(wdActiveEndAdjustedPageNumber)
lbl_Exit:
Exit Sub
End Sub
My apologies kattai, your initial post was correct.