Duplicating Multiple Cells & Columns

t5timesb

New Member
Joined
Dec 9, 2014
Messages
32
I am struggling with something and maybe it is the shear number of times I have to do this. So I have output I received from 30,888 cells (lets call them "finished goods" - below my finished good is: "FW15RH20.KBSTVS.GDRB60"). Now, I need to pair each of the "finished goods with 20 different items like shown below. Each "finished goods" cell is paired with 2 other columns (0,A).

This is an example of 1 "finished goods" paired with the columns, remember, I have 30,888 of these, HOW DO I DO THIS?

FW15RH20.KBSTVS.GDRB60

<colgroup><col><col></colgroup><tbody>
</tbody>

<colgroup><col><col></colgroup><tbody>
</tbody>
0A
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
1B
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
2C
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
3D
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
4E
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
5F
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
6G
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
7H
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
8I
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
9J
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
10K
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
11L
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
12M
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
13N
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
14O
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
15P
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
16Q
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
17R
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
18S
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
19T
FW15RH20.KBSTVS.GDRB60

<tbody>
</tbody>
20U

<tbody>
</tbody>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
The first didn't work for me. Anyone else help?

Code:
Sub FinishedGoods()

    'with the sheet of imported data active... do the following Macro.
    Application.ScreenUpdating = False
    lastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    FGRows = lastRow * 21 'if the numbers go fromm 0-20 that's 21 numbers...
    ActiveWorkbook.Worksheets.Add After:=Worksheets(Worksheets.Count) 'I'll just put everything in a new worksheet
    ActiveSheet.Name = "Finished Goods" ' named Finished Goods
    ActiveCell.FormulaR1C1 = "=INDIRECT(""Sheet1!A""&INT(ROW(R[20]C)/21))" 'this will be VERY SLOW
    Range("B1").FormulaR1C1 = "=MOD(ROW()+20,21)" 'this gets the numbers 0-20 in column B
    Range("C1").FormulaR1C1 = "=VLOOKUP(CHAR(RC[-1]+65),{""A"",""CUTOFF"";""B"",""SHAFT1"";""C"",""FERRULE"";""D"",""FERRULEFW15"";""E"",""GRIP"";""F"",""GRIP1"";""G"",""MATCHPOINT"";""H"",""CLUBHEAD"";""I"",""ASSEMBLY"";""J"",""GRINDFERRULES"";""K"",""LOFT/LIE"";""L"",""LASER"";""M"",""CLEAN"";""N"",""BAND"";""O"",""ISLABEL"";""P"",""PACK"";""Q"",""BXSET15"";""R"",""INCFREIGHT"";""S"",""DIRECTLA"";""T"",""VARIABLEOH"";""U"",""FIXEDOH""},2,TRUE)" 'this gets the letters A thru U in column C
    Range("A1:C1").AutoFill Destination:=Range("A1:C" & FGRows) 'because it's slow, I will paste over itself with just the values.
    Range("A1:C" & FGRows).Copy
    Range("A1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    Columns("A:A").EntireColumn.AutoFit
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,359
Messages
6,124,488
Members
449,166
Latest member
hokjock

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