ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Custom auto fill question (https://www.excelbanter.com/excel-discussion-misc-queries/61809-custom-auto-fill-question.html)

method373

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


--
method373
------------------------------------------------------------------------
method373's Profile: http://www.excelforum.com/member.php...o&userid=29888
View this thread: http://www.excelforum.com/showthread...hreadid=495906


jtp

Custom auto fill question
 

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


method373 Wrote:
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



--
jtp
------------------------------------------------------------------------
jtp's Profile: http://www.excelforum.com/member.php...o&userid=21132
View this thread: http://www.excelforum.com/showthread...hreadid=495906


method373

Custom auto fill question
 

Awesome! That worked perfectly! Thanks so much!


--
method373
------------------------------------------------------------------------
method373's Profile: http://www.excelforum.com/member.php...o&userid=29888
View this thread: http://www.excelforum.com/showthread...hreadid=495906



All times are GMT +1. The time now is 07:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com