I am creating a macro for merging multiple cells in column C based on the merged cells in column A. While doing this I want to retain all the values along with rich text formatting. For example if column A1:A3 is merged, I want to merge column C1:C3 while retaining all text in the cells with rich text formatting. I have created the code below and not sure how to proceed further. I could use some help here. Thanks.
Sub mergingcells()[/COLOR] Dim rng As Range Dim rng1 As Range Dim i As Integer, j As Integer, k As Integer, l As Integer Dim c As Long Dim lastrow As Long Dim asd As String With ActiveSheet lastrow = Range("A1").SpecialCells(xlCellTypeLastCell).Row End With c = 3 Range("C3").Select For k = 3 To lastrow Range("c" & c).Select i = Range("A" & c).MergeArea.Rows.count j = c + i - 1 asd = "" For l = c To j Range("C" & l).Copy Range("C" & c).PasteSpecial Paste:=xlPasteAll asd = asd & " " & Range("c" & l) Next Range("c" & c) = asd Range("A" & c, "A" & j).Copy Range("C" & c).Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False c = c + i Next End Sub