Copy down X number of times

hatstand

Well-known Member
Joined
Mar 17, 2005
Messages
778
Office Version
  1. 2016
Platform
  1. Windows
HI All,

What I thought was a simple thing to do, I'm struggling to solve. I'm trying to modify this line:

Range("A2").AutoFill Destination:=Range("A2:A10"), Type:=xlFillSeries

I trying to copy down a formula a set number of times based on a cell value or a declared value.

Am I missing the obvious?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi,

I don't get an error. It only copies down the range specified. i.e. A2:A10. I would like to be able to enter a figure in a cell and the formaula is filled down that number of times.
 
Upvote 0
Hi hatstand,

If the value is in cell A1 (change to suit) try this:

Code:
Range("A2").AutoFill Destination:=Range("A2:A" & Range("A1").Value + 1), Type:=xlFillSeries

You would use the same concept for a declared variable.

HTH

Robert
 
Upvote 0
Thanks so much. I've just spent the best part of 2 hours trying to do that. Your help is very appreciated.
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,795
Members
452,943
Latest member
Newbie4296

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