Fill Down But Increment in Group

frank933

New Member
Joined
Oct 9, 2010
Messages
23
I have items in a column like below:


50
50
50
50

What I would like to be able to do is highlight the four 50's and fill down, but I would like for it to increment and paste the next four filled like this:

51
51
51
51

Then below that the next four filled like this:

52
52
52
52

If its a macro that'll be required I'd like to to be able to change the number of rows to be repeated (4 in this case, but could change).

Any help would be appreciated.
Thanks
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
One simplisctic way; enter the first 4 numbers manually and then on the 5th row use a formula to add a 1 to the first number and copy down.

For example:
Excel Workbook
A
150
250
350
450
551
651
751
851
952
1052
1152
1252
1353
1453
1553
1653
1754
1854
1954
2054
2155
2255
2355
2455
2556
2656
2756
2856
Sheet1
 
Upvote 0
Here is a macro that does what you want (actually, it does a little bit more than what you asked for)...
Code:
Sub CopyAndIncrement()
  Dim X As Long, CellCount As Long, FullRange As Range
  CellCount = Selection.Rows.Count
  On Error GoTo NothingSelected
  Set FullRange = Application.InputBox("Select the new cells to fill (include the orignal cells in your selection)...", Type:=8)
  For X = CellCount To FullRange.Rows.Count - 1
    FullRange(1).Offset(X) = FullRange(1).Offset(X - CellCount) + 1
  Next
NothingSelected:
End Sub
To use the macro, first select the cells you want to copy down and increment, then run the macro... it will ask you to select the range to fill... make sure you select the cells you originally had selected plus the new cells you want to fill with incremented values... when you click the OK button, the cells will be filled with the incremented values.

So, at the beginning of this message, I said the macro does more than what you asked for, here is what I meant. Your request was for values that were all the same... and the code works for them, but the values do not all have to be the same. For example, if your original cells contained these values...

1
22
17
8

and you select a total of 12 cells (including the original 4) in response the the InputBox request, then the macro will fill them like this...

1
22
17
8
2
23
18
9
3
24
19
10

Each individual cell's value is increment during the repeat cycle. Of course, if all the original cell values are the same, then the repeat cycles will look like they incremented as a group (which is what you asked for), but actually they are each incrementing individually (they just happen to contain the same starting values, which is what give the illusion of being grouped).
 
Upvote 0
frank933,

A non-vba possibility?

Your starter number in cell A1 and the number of repeats in any spare cell eg here D1

Then with formula in A2, drag down as needed. Repeats will change if you change value in D1


Excel 2007
ABCD
150Repeats4
250
350
450
551
651
751
851
952
1052
1152
1252
1353
1453
1553
1653

<COLGROUP><COL><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</TBODY>
Sheet2

Worksheet Formulas
CellFormula
A2=$A$1+ROUNDUP(ROW()/$D$1,0)-1

<THEAD>
</THEAD><TBODY>
</TBODY>

<TBODY>
</TBODY>



Hope that helps.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,374
Messages
6,124,566
Members
449,171
Latest member
jominadeo

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