Adding Rows based on cell value entered

Rajiv87

New Member
Joined
Jan 14, 2016
Messages
1
Hi,

I want to add no of rows based on the value I enter in a particular cell.

For example, if I enter 4 in a cell I should get 4 rows added.

Any ideas or macros to do so???
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,263
Office Version
  1. 2013
Platform
  1. Windows
You put "4" into what cell?
You insert 4 rows where?
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,263
Office Version
  1. 2013
Platform
  1. Windows
Put the value "4" in cell A1
Select a cell in the row where you want the rows inserted and run this script:
And 4 rows will be inserted below your active cell.
Change the value marked in red to your liking.
Code:
Sub Insert_Me()
Dim aa As Integer
aa = Cells([COLOR="#FF0000"]1, 1[/COLOR]).Value
ActiveCell.Offset(1).Resize(aa).EntireRow.Insert
End Sub
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,123,291
Messages
5,600,760
Members
414,405
Latest member
Zaurb

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top