+ Reply to Thread
Results 1 to 3 of 3

Filling cells in a column with a repeating random number series

  1. #1
    Registered User
    Join Date
    12-22-2011
    Location
    Oaikland, CA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Filling cells in a column with a repeating random number series

    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

  2. #2
    Registered User
    Join Date
    07-28-2011
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Filling cells in a column with a repeating random number series

    Please Login or Register  to view this content.
    This code finds the last row that contains data and the selects column B rows 2 thorugh the last row. You should be able to play with this to get it the way you need it. Hope this helps.
    ExcelCasinoGames.com

  3. #3
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Filling cells in a column with a repeating random number series

    If you want do it in one line

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1