October 7, 2021
Hi,
I have a file that one of its columns has some of its cells merged.
Is there a clever way to search for those merged cells, and is there a way to unmerge these cells and fill them with the right value?
I guess if you can un-merge those cells you can write a simple formula that will fill the empty cells, but I'm looking for something that does it all at once.
Regards,
Ayal Telem.
Trusted Members
October 17, 2018
I suggest you take a look here
Find merged cells - Microsoft Support
A little advice: AVOID merged cells if you can it's a P in the A when processing worksheets
Answers Post
Trusted Members
Moderators
November 1, 2018
You can unmerge all the cells in the column at once. If you need to specifically find merged cells, unmerge them and then populate them with the original merged cell value and there might be other blank cells in the column, then you would need code to do it, but it wouldn't be complex - something like:
Sub UnmergeAndRepopulate()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Selection.Cells
If cell.MergeCells Then
Dim v
v = cell.Value
Dim mergedRange As Range
Set mergedRange = cell.MergeArea
With mergedRange
.UnMerge
.Value = v
End With
End If
Next cell
End Sub
1 Guest(s)