How to Insert Rows in Excel Worksheet using VBA – Solution(s)
How to Insert Rows in Excel Worksheet using VBA – Solution(s): We can insert use EntireRow.Insert method to insert rows. The following is the example code to inserting rows in excel worksheet. VBA insert rows excel – An Example The following example will show you how to insert a row in Excel Worksheet. You can insert multiple rows at a time. Code: Sub sbInsertingRows() 'Inserting a Row at at Row 2 Range("A2").EntireRow.Insert ' 'Inserting 3 Rows from 3 Rows("3:5").EntireRow.Insert End Sub Instructions: Open an excel workbook Press Alt+F11 to open VBA Editor Insert a Module for Insert Menu Copy the above code and Paste in the code window Save the file as macro enabled workbook Press F5 to run it Input: Shcreen-shot of example, before executing of the above code. You can see the 10 rows of data available in the worksheet. Output: Shcreen-shot of example, after executing of the above code. You can see the 4 new rows are inserted...

Comments
Post a Comment