Automatically adding rows

Biffarama

New Member
Joined
May 18, 2010
Messages
27
Hello,

I'm wondering if there's a way to enter a number into a field and have that many rows created in another part of the sheet? For instance, in the example below, when I replace the "?" with a number I would like that number of rows created under the Jan-13 row, using the same formatting. Is this possible in Excel 2010?

Thanks,
Troy


Step 1Account Details
1aAccount NameTemplate
1bContract Start Date1/1/13
1cNumber of Months?
1dAccount Value$XXXX
1eDesired Margin2.5
1fMonthly CapXX
Step 2Labor costs
Tier CostSeat CostTotal
Jan-13

<tbody>
</tbody>
 
Thank you very much for that.

One more question, can I specify in the code where I want the added lines to go? For instance, if I want them added after row 17?
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Thank you very much for that.

One more question, can I specify in the code where I want the added lines to go? For instance, if I want them added after row 17?
Change C17 to your Range From Where your want to Insert Row
Rich (BB code):
Sub Insert_Row() 
Range("C17").Select
Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(ActiveCell.Value, 0)).EntireRow.Insert 
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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
Back
Top