Copying row equal to amount entered in cell

Frank_N

New Member
Joined
Jul 23, 2011
Messages
2
Hi,

Hope this won't be too confusing. I want to enter a number, for example 5 in an 'input' cell and that will copy a row which has formulas in some cells the same number of times as entered in the 'input' cell.

For example I enter 5 in cell A1 and that would copy/add 5 rows with the info/formulas from rows A3 - I3

Hope that makes sense.

Thanks in advance for any help
Frank
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Whilst I am sure someone will comeback with a more efficient way. How about assigning the following to a button?

Code:
Private Sub CommandButton1_Click()
    
    Sheets("Sheet1").Range("A3:I3").Select
    Sheets("Sheet1").Range("A3:I3").Copy
    
    Selection.End(xlDown).Select
    Selection.Offset(1, 0).Select
    
    Sheets("Sheet1").Range(Selection.Address & ":I" & Selection.Row + Sheets("Sheet1").Range("A1").Value).Select
    ActiveSheet.Paste
        
End Sub

...it seems to get the job done :)

...but, of cause, depending on you spreadsheet may need a little tweaking.

D
 
Upvote 0
Thanks for the help Tuelor but I can't get it to work... I keep getting an error.

Application-defined or object-defined error

Thanks again for your time and help
Frank
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,849
Members
452,948
Latest member
UsmanAli786

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