• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

VBA code to concatenate disproportionate data in MS Excel 2007

Dear experts,

I'm having trouble by concatenating data shown in the image attached.

Can you please assist?

Regards
1.JPG
0
sarpcakir
Asked:
sarpcakir
1 Solution
 
Saqib Husain, SyedEngineerCommented:
Try this macro
Sub clrcat()
clr = Cells(2, 1).Interior.Color
For i = 2 To Cells(2, 1).End(xlDown).Row
    If Cells(i, 1).Interior.Color = clr Then
        pfx = Cells(i, 1)
    Else
        Cells(i, 2) = pfx & Cells(i, 1)
    End If
Next i
End Sub

Open in new window

0
 
sarpcakirAuthor Commented:
Thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now