Last active
April 21, 2021 05:44
-
-
Save jfthuong/1767571 to your computer and use it in GitHub Desktop.
Insert a given number of rows in a MS Word Table (VBA)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Insert_x_rows() | |
' | |
' Insert a given number of rows into a MS Word Table | |
' | |
' | |
Dim n_rows As Integer | |
n_rows = InputBox("How many rows shall be inserted?", "Insert Rows") | |
Selection.InsertRowsBelow n_rows | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the comments and suggestions @aamailhot.
The code I wrote was loaded in my default template of MS Word and linked to a button to create rows (hence the InputBox and selection).
Indeed, for a fully automatized workflow, you would need:
Cheers