Filling cells in a column with a repeating random number series

calsteve

New Member
Joined
Dec 22, 2011
Messages
3
Hi,

I am importing data from an access table into a spreadsheet.

It is a different number of records each time.
The macro I have will add and name a new column and find the last cell.

What I need to do is have the series 1 -11 repeated in the column to the last cell. I have this macro, but it relies on specific cell references. B2 will always be the same, but the end number in the range will change.
How can I make it so that it will start at the end each time?
Thanks,

Sub autonumber_ft_audit()
'
' autonumber_ft_audit Macro
' Macro recorded 12/22/2011 by a745392
'

ActiveCell.FormulaR1C1 = "11"
Selection.AutoFill Destination:=Range("B233:B243"), Type:=xlFillSeries
Range("B233:B243").Select
Range(Selection, Cells(1)).Select
ActiveWindow.SmallScroll Down:=142
ActiveWindow.LargeScroll Down:=-4
Range("B2").Select
Range("B233:B243").Select
Range("B243").Activate
Selection.AutoFill Destination:=Range("B2:B243"), Type:=xlFillCopy
Range("B2:B243").Select
Range("A1").Select
ActiveWorkbook.Save
End Sub
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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