# if previous column data in merged cell, count merged rows, combine data in next column corresponding rows in to 1 row

#### leecavturbo

##### Well-known Member
a1-a3 are merged, data in unmerged b1-b3 correspond to data in a1-a3. combine data from b1-b3 to b1. then unmerge a1-a3
then delete empty rows
then repeat down.

EG
(11-sep vis is in merged a1-a3. pretty pigs is in b1,tamworth in b2 and b in b3) so cut tamworth and b and paste on the end of pretty pigs. now unmerge a1-a3 and then delete empty row 2 and 3. then repeat down until no data in column a

11-Sep VIS PRETTY PIGS
TAMWORTH
B
BOARD

FIXED UNMERGED

11-Sep VIS PRETTY PIGS TAMWORTH B

### Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hiya
Give this a go on a copy of your data
Code:
``````Sub UnMergeMe()

Dim CurCl As Range
Dim NxtCl As Range
Dim Rws As Integer
Dim I As Integer

Set CurCl = Range("A1")
Do
Set NxtCl = CurCl.Offset(1)
Rws = NxtCl.Row - CurCl.Row - 1
CurCl.UnMerge
For I = Rws To 1 Step -1
CurCl.Offset(I - 1, 1) = CurCl.Offset(I - 1, 1) & " " & CurCl.Offset(I, 1)
CurCl.Offset(I).EntireRow.Delete
Next I
Set CurCl = CurCl.Offset(1)
Loop While CurCl.Value <> ""

End Sub``````

Replies
8
Views
1K
Replies
1
Views
443
Replies
12
Views
556
Replies
21
Views
555
Replies
1
Views
638

1,196,079
Messages
6,013,309
Members
441,760
Latest member
Sharina

### 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.

### Which adblocker are you using?

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

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