S
spunkymuffmonkey
Hi,
I am currently creating an automated form in which there's a table. In this
table users record various details regarding risks. The table contains 10
rows and seven columns with form fields in each cell (apart from the heading
row), each risk is recorded across a row.
My problem is that the number of rows a user might complete on this form
could be over 10, users mostly won't go over ten, but when they do I want the
form to automatically add a row to the end of the table with the form fields
copied in to the new row.
Using my primative VBA knowledge I have managed to create the following but
cannot work out how to paste my selection at the end of the table.
Sub AddRow()
ActiveDocument.Unprotect
ActiveDocument.Tables(1).Rows(2).Select
Selection.Copy
Selection.Paste
ActiveDocument.Protect wdAllowOnlyFormFields
End Sub
I have seen other posts within the forum
(http://www.microsoft.com/communitie...7e03f1-950d-4edb-8d9b-0d1670d54d42&sloc=en-us)
but cannot get the example to work as the code tells me there is a syntax
error when I run it and some of the code appears in red when I paste it into
the code window.
Please help!
I am currently creating an automated form in which there's a table. In this
table users record various details regarding risks. The table contains 10
rows and seven columns with form fields in each cell (apart from the heading
row), each risk is recorded across a row.
My problem is that the number of rows a user might complete on this form
could be over 10, users mostly won't go over ten, but when they do I want the
form to automatically add a row to the end of the table with the form fields
copied in to the new row.
Using my primative VBA knowledge I have managed to create the following but
cannot work out how to paste my selection at the end of the table.
Sub AddRow()
ActiveDocument.Unprotect
ActiveDocument.Tables(1).Rows(2).Select
Selection.Copy
Selection.Paste
ActiveDocument.Protect wdAllowOnlyFormFields
End Sub
I have seen other posts within the forum
(http://www.microsoft.com/communitie...7e03f1-950d-4edb-8d9b-0d1670d54d42&sloc=en-us)
but cannot get the example to work as the code tells me there is a syntax
error when I run it and some of the code appears in red when I paste it into
the code window.
Please help!