Add rows to all Tables in a worksheet

Adam asked a question in the how to find the last row on a sheet with tables post. He wanted to know how to insert a row into every Table in the worksheet. Well, it’s a slightly different problem than just finding out what the last row is on a sheet.

The ‘TestAddRows’ routine is the one to call. It runs an insert to the last row of all Tables on the active worksheet. There’s a second test routine where it shows how you can specify the worksheet to perform the task on.

The ‘AddRowsToAllTables’ routine runs the insert to all Tables in the specified sheet. If no sheet is specified it uses the active sheet

The ‘InsertRows’ routine is where the magic happens. This does all the necessary checks and settings for inserting a row in a Table.

 

Leave a Reply

Your email address will not be published. Required fields are marked *