Duplicate Cell Referencing

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:
[TABLE="width: 500"]
<TBODY>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD]Mango[/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
</TBODY>[/TABLE]
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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