+ Reply to Thread
Results 1 to 3 of 3

Custom auto fill question

  1. #1
    Registered User
    Join Date
    12-24-2005
    Posts
    9

    Custom auto fill question

    I have a series of rows that I need to auto fill in a certain way - It would basically be the same thing as filling a series like 1,2,3,4,5,6,7,8,9,10 but it would have to be every 14 rows: (example below)

    Is there any way to do this without manually entering them? I have thousands I have to fill in, and it will take me forever to do it manually

    Thanks!

    example:

    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3

  2. #2
    Forum Contributor
    Join Date
    03-15-2005
    Location
    North Carolina
    MS-Off Ver
    2003 & 2007
    Posts
    180
    Hey Method,
    Give this a shot

    Sub test()
    Dim cell As Range, i!, z%, j%

    Set cell = Range("A1")
    z = 1
    For i = 0 To 1000 Step 14
    For j = 1 To 14
    cell.Offset(i + j, 0).Value = z
    Next j
    z = z + 1
    Next

    End Sub


    This will put the first 1 in A2 just in case you have a header row. Set the upper limit of the first for loop to w/e you need to be. For instance if you need to go to 3000, make the upperlimit 14*3000=42000. Hope this helps,

    Jason


    Quote Originally Posted by method373
    I have a series of rows that I need to auto fill in a certain way - It would basically be the same thing as filling a series like 1,2,3,4,5,6,7,8,9,10 but it would have to be every 14 rows: (example below)

    Is there any way to do this without manually entering them? I have thousands I have to fill in, and it will take me forever to do it manually

    Thanks!

    example:

    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    2
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3
    3

  3. #3
    Registered User
    Join Date
    12-24-2005
    Posts
    9
    Awesome! That worked perfectly! Thanks so much!

+ 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