apologize if this is a common post, but couldn't find something that fully applies to me.
It's a very similar post to (except that instead of just merging the 2 cells, i am looking to merge and concatenate): Macro to merge cells in Excel for rows in which information in other columns matches
Referencing the image in the post above, what i am looking for are cells P2 and P3 to be merged and the data to be concatenated. For eg: if P2 had abc, and P3 had xyz, i am looking for end product to be abcxyz in the merged cell.
Any help would be greatly appreciated. What i have only enables me to merge, but i am not sure how to concatenate it.
Sub Main()
Dim i As Long
Dim j As Long
Dim sameRows As Boolean
sameRows = True
For i = 1 To Range("A" & Rows.Count).End(xlUp).Row
For j = 1 To 6
If StrComp(Cells(i, j), Cells(i + 1, j), vbTextCompare) Then
sameRows = False
End If
Next j
If sameRows Then
Range(Cells(i, 7), Cells(i + 1, 7)).Merge
End If
sameRows = True
Next i
End Sub