Sub KillMerges()
Dim c As Range
Dim xCell As Range
Dim xValue As Variant
Set c = FindMergedCells(ActiveSheet.Cells)
Application.ScreenUpdating = False
If Not c Is Nothing Then
For Each xCell In c
xCell.Select
xValue = xCell.Value
xCell.UnMerge
Selection = xValue
Next
End If
Application.ScreenUpdating = True
End Sub
Function FindMergedCells(RangeToSearch As Variant) As Range
Dim MergedCell As Range, FirstAddress As String
If TypeName(RangeToSearch) = "String" Then Set RangeToSearch = Range(RangeToSearch)
Application.FindFormat.MergeCells = True
Set MergedCell = RangeToSearch.Find("", LookAt:=xlPart, SearchFormat:=True)
If Not MergedCell Is Nothing Then
FirstAddress = MergedCell.Address
Do
If FindMergedCells Is Nothing Then
Set FindMergedCells = MergedCell
Else
Set FindMergedCells = Union(FindMergedCells, MergedCell)
End If
Set MergedCell = RangeToSearch.Find("", After:=MergedCell, LookAt:=xlPart, SearchFormat:=True)
If MergedCell Is Nothing Then Exit Do
Loop While FirstAddress <> MergedCell.Address And Not MergedCell Is Nothing
End If
End Function