Avatar of zack carter
zack carter
 asked on

Fill series of sequential numbers in blocks of 2

VBA fil down block of 2 identical sequential numbners in column B starting at row 2 until last row of data in column c.

I have searched high and low for a logical approach at  this and I cant seem to find it anywhere.

I need to be able to fill column B cell B2 downwards until last row of data in column C.


Example below:


1
1
2
2
3
3
4
4
5
5


so forth until the last row of data in column C.

I have managed to get to the point i can do it sequentially but not how i want it to work.

Any help aprciated:
Lst = Range("C" & Rows.count).End(xlUp).Row - 1
With Range("B2")
    .Value = "1"
    .AutoFill Destination:=Range("B2").Resize(Lst), Type:=xlFillSeries
End With

Open in new window

VBAMicrosoft ExcelMicrosoft ApplicationsMicrosoft Office

Avatar of undefined
Last Comment
Rob Henson

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Subodh Tiwari (Neeraj)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
zack carter

ASKER
Thank you so much for your assistance. I cannot thank you enough. Its taken me 3 days to tackle this.

Also i havent heard of the "=QUOTIENT(ROW(),2)" so i have definately lerarnt something new.
Subodh Tiwari (Neeraj)

You're welcome Zack! Glad it worked as desired.
Rob Henson

Does it have to be VBA??

Fill in rows 2 & 3 manually with number 1. Then in B4 put formula =B2+1

Then hover the cursor over the bottom right of cell B4 until it turns to a + symbol, double click and the formula will be populated down to the extent of data in column C or column A if more data.
Your help has saved me hundreds of hours of internet surfing.
fblack61