LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Senior Member
 
Location: Belo Horizonte, Brazil
Posts: 170
Thumbs up

Hi People, Good Evening.

This question was solved by the gentle Isabelle.
Thanks again.

The answer:
-------------------------------------------------------------
Sub test()
Dim i As Integer, n1 As Integer, n2 As Integer
n1 = 1
For i = 1 To 3000 Step 3
n2 = n2 + 1
With Sheets("Sheet2")
Sheets("Sheet1").Range("A" & n1).Copy .Range(.Cells(i, 1), .Cells(i + 2, 1))
Sheets("Sheet1").Range("B" & n2).Copy .Range(.Cells(i, 2), .Cells(i + 2, 2))
Sheets("Sheet1").Range("C1:C3").Copy .Range(.Cells(i, 3), .Cells(i + 2, 3))
Application.CutCopyMode = False
End With
If n2 = 20 Then n1 = n1 + 1: n2 = 0
Next
End Sub
-------------------------------------------------------------

Topic can be CLOSED.

Quote:
Originally Posted by Mazzaropi View Post
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Columns Bob[_19_] New Users to Excel 2 May 9th 10 09:08 PM
Combining Text from 2 Columns into 1 then Deleting the 2 Columns sleepindogg Excel Worksheet Functions 5 September 19th 08 12:36 AM
Combining columns????? rhcpcf Excel Worksheet Functions 1 January 15th 08 08:03 PM
Combining columns jezzica85 Excel Discussion (Misc queries) 2 March 11th 06 12:22 PM
Combining columns? sus Excel Worksheet Functions 1 November 18th 05 08:13 PM


All times are GMT +1. The time now is 11:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"