Combining THREE columns to a new TAB
Hi People, Good Morning.
I need to use three columns of data to generate a new group in another tab.
The new one will be a combinations of all the three columns.
A little example:
Sheet 1:
A_______B_______C
CAR_____BLUE____BIG
BUS_____RED_____SMALL
________YELLOW
Waited results at Sheet 2:
A_______B_______C
CAR_____BLUE____BIG
CAR_____BLUE____SMALL
CAR_____RED_____BIG
CAR_____RED_____SMALL
CAR_____YELLOW__BIG
CAR_____YELLOW__SMALL
BUS_____BLUE____BIG
BUS_____BLUE____SMALL
BUS_____RED_____BIG
BUS_____RED_____SMALL
BUS_____YELLOW__BIG
BUS_____YELLOW__SMALL
I found here a code that works perfectly.
But was made to use TWO columns.
It was made by a forum user: Isabelle.
----------------------------------------------------
Sub test()
Dim i As Integer, x As String, y As String, n As Integer
For i = 1 To 17500 Step 350
..n = n + 1
..With Sheets("Sheet2")
....Sheets("Sheet1").Range("A" & n).Copy .Range(.Cells(i, 1), .Cells(i + 349, 1))
....Sheets("Sheet1").Range("B1:B350").Copy .Range(.Cells(i, 2), .Cells(i + 349, 2))
....Application.CutCopyMode = False
..End With
Next
End Sub
----------------------------------------------------
I tried to adapt this code to a THREE column of data.
But I´m getting errors.
Please, could someone help me with this?
I have three columns of data:
A1:A50 - Music partitures
B1:B20 - Musical instruments
C1:C3..- Participation
50 itens * 20 itens * 3 itens = 3,000 itens
If anyone can help I will apreciate a lot.
I´m just a beginner in VBA.
Thanks in advance.
Have a nice day.
__________________
I hope it can help you.
Best regards,
Marcilio Lobão
---------------------------
Belo Horizonte, Brazil
|