• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Excel Tutorials

Microsoft Excel Tutorials

  • Home
  • Microsoft Excel Tutorials
  • Learn
    • Formulas
    • Power Query
    • Errors
    • Videos
    • Charts
    • Shortcuts
    • Pivot Tables
    • Macros
    • Basics
    • Analysis
  • 240+ Excel Shortcuts
  • Privacy Policy
You are here: Home / Macros / How to Use Macros in Excel to Insert Multiple Rows
How to Use Macros in Excel to Insert Multiple Rows

How to Use Macros in Excel to Insert Multiple Rows

posted on July 23, 2019

Insert Multiple Rows Using Excel Macros

If you need to insert multiple rows using Macros in Excel then you can do this easily with the help of Macros. Enable your Developer Tab of excel before doing this.

Purpose of this tutorial: you will learn to using macros for inserting multiple rows.

Before following the procedure of this tutorial make sure you have enabled the Excel’s Developer Tab.

STEP 1: GO TO DEVELOPER> CODE> VISUAL BASIC> COPY/PASTE THE CODE BELOW > CLOSE THE WINDOW

Copy The Code Below;

Sub InsertMultipleRows()

Dim numRows As Integer
Dim counter As Integer

‘Select the current row
ActiveCell.EntireRow.Select
On Error GoTo Last
numRows = InputBox(“Enter number of rows to insert“, “Insert Rows”)

‘Keep on inserting rows until we reach the desired number
For counter = 1 To numRows
Selection.Insert Shift:=xlToDown, CopyOrigin:=xlFormatFromRightorAbove
Next counter
Last:Exit Sub
End Sub

Insert Multiple Rows

STEP2. Test it by selecting any cell in which you need to insert rows on then follow

Go to Developer > Code > Macros > Run

Insert Multiple Rows
Here we need to insert 4 rows. So we will Type in 4.

By using Macros within three steps now you can insert multiple rows.

Insert Multiple Rows

Learn NEXT : How to Use Macros in Excel to Insert Multiple Columns

Filed Under: Macros Tagged With: excel macros, Insert Multiple Rows, Macros

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

Download 240+ Shortcuts

Microsoft Excel comes with varieties of keyboard shortcuts which are stated below with excel shortcut name and its keys for Windows and Mac.

Categories

  • Basics
  • Formulas
  • Pivot Tables
  • Charts
  • Power BI
  • Analysis
  • Shortcuts
  • Macros
  • Add-Ins

Recent Comments

  • Olivia on Convert Formulas to Values in Excel
  • Pkv on How to Insert Comment In Power Query Steps?
  • Rahul on How to Insert Comment In Power Query Steps?
  • David on How to Insert Comment In Power Query Steps?
  • sofia on How to use Workday Formula in Excel?

Footer CTA

Get Weekly Updates in your mailbox

Get Started Now

Copyright © 2021