Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Excel data content listed in 3 columns into a single column
My speadsheet looks like this:
Name Computer name count Jones cpu1 5 Jones cpu2 6 Jones cpu4 15 I need for it to appear like this: Name Computer name count Jones cpu1,cpu2 and cpu4 26 How can this be accomplished. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Excel data content listed in 3 columns into a singlecolumn
Try the macro below.
To use the macro: 1) Have the data sorted by the "Name" column. 2) Select any cell in your data 3) Run the macro '------------------------- Sub combine_rows() Dim tmp As Single, tmp2$ tmp2 = Selection.Range("A1").CurrentRegion.Address(False, False) With ActiveSheet.Range(tmp2).Columns(1) If .Rows.Count = 2 Then For tmp = .Rows.Count To 2 Step -1 If .Rows(tmp).Value = .Rows(tmp - 1).Value Then .Rows(tmp - 1).Offset(0, 1).Value = _ .Rows(tmp - 1).Offset(0, 1).Value & ", " & _ .Rows(tmp).Offset(0, 1).Value .Rows(tmp - 1).Offset(0, 2).Value = _ .Rows(tmp - 1).Offset(0, 2).Value + _ .Rows(tmp).Offset(0, 2).Value .Rows(tmp).EntireRow.Delete End If Next End If End With End Sub '------------------------- Regards, Edwin Tam http://www.vonixx.com On 1/12/05 11:33 AM, in article , "mooorrona" wrote: My speadsheet looks like this: Name Computer name count Jones cpu1 5 Jones cpu2 6 Jones cpu4 15 I need for it to appear like this: Name Computer name count Jones cpu1,cpu2 and cpu4 26 How can this be accomplished. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Multiple Columns, Paste Under a Single column | Excel Worksheet Functions | |||
I would like to copy UNIQUE data from a column in a SINGLE CELL | Excel Discussion (Misc queries) | |||
How do I print a single column of data in two columns on one page | Excel Discussion (Misc queries) | |||
how to convert multiple columns of data into one single column? | Excel Worksheet Functions | |||
Move Different Columns of Data to Single Column. | Excel Programming |