Expanding on 'concatenate-maybe-countif-but-how'

MrCapita

New Member
Joined
Apr 25, 2013
Messages
1
Dear Masters of Excel,

Expanding on an old thread - http://www.mrexcel.com/forum/excel-questions/356861-concatenate-maybe-countif-but-how.html - I could do with a little help.

Mr Excel offers the macro;

Sub
Rearrange()
Dim lr AsLong, r AsLong

Application.ScreenUpdating = False
lr = Range("A" & Rows.Count).End(xlUp).Row
For r = lr To 2 Step -1
With Cells(r, 1)
If .Value = .Offset(-1).Value Then
.Offset(-1, 1).Value = .Offset(-1, 1).Value & ", " _
& .Offset(, 1).Value
.EntireRow.Delete
EndIf
EndWith
Next r
Columns("B").AutoFit
Application.ScreenUpdating = True
EndSub

This works great for combining fields in a single column. However, I need to combine 2 columns, I need to turn this;

Room numberFurniture TypeCount
1Table3
1Chair3
1Cat1
2Rug23
3Planet1
3Chair6

<tbody>
</tbody>

into this;
Room Number
1Table 3, Chair 3, Cat 1
2Rug 23
3Planet 1, Chair 6

<tbody>
</tbody>


Any help at all would be really great...
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
=sumproduct((a1:a6=1)*(B1:b6=table)) returns 3

instead of the 1 and table in that formula, reference row and column headings and then adjust the looks of your output table. Very simple approach.
 
Upvote 0

Forum statistics

Threads
1,214,402
Messages
6,119,301
Members
448,885
Latest member
LokiSonic

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