• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to insert 10 rows at the end of the table

S P P

Member
How to insert 10 rows at the end of the table

insert 1 rows at the end of the table I have VBA
 

Attachments

  • SPP How to insert 10 rows at the end of the table.xlsm
    22.5 KB · Views: 2
As when using an Excel table the row insertion is automatic so no need obviously any VBA procedure …​
 
Marc L

I thought there would be a way to insert the newline as Vba at the end.

There is a way to repeat this newline VBA like clicking multiple times
 
I got it like this

>>> use code - tags <<<
Code:
Sub Insert10LineattheEnd()
    For Counter = 1 To 10
    Run "Insert1LineattheEnd"
    Next Counter
End Sub
Sub Insert1LineattheEnd()
    ActiveSheet.ListObjects(1).ListRows.Add
End Sub
 
Last edited by a moderator:
or, more simply, to save ink in case someone wants to insert your code in a book;)

Code:
Sub Insert10LineattheEnd()
    For Counter = 1 To 10
     ActiveSheet.ListObjects(1).ListRows.Add
    Next Counter
End Sub
 
Keetoowah

It also works but simpler.
I always try to simplify the VBA I use.

thanks for simplifying

>>> use code - tags <<<
Code:
Private Sub CommandButton1_Click()
    For Counter = 1 To 10
     ActiveSheet.ListObjects(1).ListRows.Add
    Next Counter
End Sub
 
Back
Top