Microsoft Office Tutorials and References
In Depth Information
Forms: Deleting a Table Row
6. Now go back into each form field Options in the data row and append an
underscore plus the number one (_1) to each form field name. This
ensures that the names are different from those in the AutoText entry.
For each calculation that references such form fields, update the names
the calculation references to reflect the names that have been changed
to include the underscore and number.
Note: This technique only works with a template, because only templates can store
AutoText entries—documents cannot.
Forms: Deleting a Table Row
Delete the current row (the row at the insertion point) from a table in a
protected form.
Example file:
Scenario: A table set up in a form with multiple rows for
data entry or set up using the 'InsertNewTableRow' macro
(see preceding process) may at some point need to have
superfluous rows removed.
The following macro removes the row in which the selection
currently stands, unless it is the last data row in the table or
is a designated header or footer row.
View the Appendix to learn how to store this procedure
in a Standard module.
Option explicit¶
' * * * * *¶
'First row containing form fields¶
'that should not be deleted¶
Const StartRowIndex As Long = 2¶
' * * * * *¶
Sub DeleteCurrentRow()¶
'varaible declaration¶
Dim doc As Word.Document¶
Dim rng As Word.Range¶
Dim totalRows As Long¶
Set rng = Selection.Range¶
If rng.Information(wdWithInTable) Then¶
Search JabSto ::

Custom Search