Sub Sweet16()
Dim V As Variant, Adr16 As Variant, i As Long
With ActiveSheet.UsedRange
V = .Cells.Value
With Application
.FindFormat.Clear
.ReplaceFormat.Clear
.FindFormat.Interior.ColorIndex = 16
End With
.Replace "*", "#N/A", SearchFormat:=True, ReplaceFormat:=False
On Error Resume Next
Adr16 = Split(.SpecialCells(xlCellTypeConstants, xlErrors).Address(0, 0), ",")
Debug.Print "Ranges with colorindex 16"
For i = LBound(Adr16) To UBound(Adr16)
Debug.Print Adr16(i)
Next i
.Cells.Value = V
End With
With Application
.FindFormat.Clear
.ReplaceFormat.Clear
End With
Call FindMergedCells
End Sub
Sub FindMergedCells()
Dim c As Range, Rws As Long, Cols As Long, mA() As String, ct As Long
Application.DisplayAlerts = False
For Each c In ActiveSheet.UsedRange
If c.MergeCells Then
ct = ct + 1
Rws = c.MergeArea.Rows.Count
Cols = c.MergeArea.Columns.Count
ReDim Preserve mA(1 To ct)
mA(ct) = c.Resize(Rws, Cols).Address(0, 0)
c.UnMerge
End If
Next c
If ct > 0 Then
Debug.Print "Merged Ranges"
For i = LBound(mA) To UBound(mA)
Debug.Print mA(i)
Range(mA(i)).Merge
Next i
End If
End Sub