Akali_H

New Member
Joined
Sep 15, 2014
Messages
5
Hi Team,

I'm in need of an excel formula or VBA Code that can assist me reference column of unique values (Column A) and have each of them duplicated in 11 rows of another column (Column B). For example:
Column AColumn B
AppleApple
OrangeApple
MangoApple
Apple
Apple
Apple
Apple
Apple
Apple
Apple
Apple
Orange
Orange
Orange
Orange
Orange
Orange
Orange
Orange
Orange
Orange
Orange

<TBODY>
</TBODY>
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Arithos

Well-known Member
Joined
Aug 14, 2014
Messages
598
I have a Macro suggestion. Like so.


Code:
Sub MakeDuplicates()


LR = Sheets(1).Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To LR
FR = Sheets(1).Cells(Rows.Count, 2).End(xlUp).Row
    For j = FR To FR + 11
        Cells(j, 2).Value = Cells(i, 1).Value
    Next j
Next i


End Sub
 
Upvote 0

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
ADVERTISEMENT
You need a formula/macro to create 11 duplicates in another column?

I misread the question. That would be in B1 copied down:

=INDEX(A:A,INT((ROWS(B$1:B1)-ROW(B$1))/11)+1)
 
Upvote 0

ParamRay

Well-known Member
Joined
Aug 6, 2014
Messages
1,195
.
.

For VBA solution:

Code:
Sub DuplicateRecords()

    Dim Rang As Range
    Dim Cell As Range
    Dim Num As Long
    
    With ActiveSheet
        Set Rang = Intersect(.Columns("A"), .UsedRange)
    End With
    
    Num = 0
    For Each Cell In Rang
        With Cell
            .Offset(10 * Num, 1).Resize(11, 1).Value = .Value
        End With
        Num = Num + 1
    Next Cell

End Sub
 
Upvote 0

Akali_H

New Member
Joined
Sep 15, 2014
Messages
5
Thanks a lot Andrew Poulsom, Arithos and GPeacock. All your solutions have worked great!! Once again Thanks. :)
 
Upvote 0

Forum statistics

Threads
1,195,671
Messages
6,011,077
Members
441,581
Latest member
rp4717

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
Top