# Copy number down cell using VBA

#### akima

##### New Member
Hi Wizards,

Can you help. I need the value of A6 to be copied down in the active cell 7 times up to number 52 then start again at 1 up to 52 using <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym> e.g.

If A6 =5 and active cell is C20

C20 = 5
C21 = 5
C22 = 5
C23 = 5
C24 = 5
C25 = 5
C26 = 5
C27 = 6
C28 = 6
C29 = 6
C30 = 6
C31 = 6
C32 = 6
C33 = 6
C34 = 7
C35 = 7
C36 = 7
C37 = 7

etc up to 52 and start again at 1 up to 52.

This will need to happen whether I start from C20 or C31.

Thanks so much for your help.

### Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Try this:
Code:
``````Sub Active_Cell_Down()
Dim i As Long
Dim Lastrow As Long
Dim ans As Integer
ans = 52 - Cells(6, 1).Value + 1
Lastrow = ActiveCell.Row

For i = 1 To ans
Cells(Lastrow, ActiveCell.Column).Resize(7, 1).Value = Cells(6, 1).Value + i - 1
Lastrow = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row + 1
Next

End Sub``````

Last edited:
Thank You.. Worked perfectly.

Thank You.. Worked perfectly.

Replies
0
Views
148
Replies
0
Views
574
Replies
0
Views
191
Replies
4
Views
728
Replies
2
Views
193

1,206,816
Messages
6,075,036
Members
446,114
Latest member

### 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.

### Which adblocker are you using?

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

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