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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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
.
.

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
Thanks a lot Andrew Poulsom, Arithos and GPeacock. All your solutions have worked great!! Once again Thanks. :)
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

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
Back
Top