What version of excel are you supporting?
xl2002 (it's there in xl2003 for sure!) added an option to search by format.
Before excel offered that Edit|find option, the only way I know is to loop
through the .usedrange.
Try this manually in excel.
Start a new workbook.
Merge a few cells (mark them nicely with a fill color???).
Then do Edit|find
Click on the Options button if you don't see them.
Click on the Format button
Remove everything that you don't want, but make sure "merge" is selected on the
Alignment tab.
Then you could use Find in your code to look for just merged cells.
If I remember correctly, VBA's .FindNext doesn't remember the format settings,
so you'll have to use successive .Find's.
In excel's VBA, I'd use:
Option Explicit
Sub testme()
Dim wks As Worksheet
Dim myMergedCells As Range
Dim FoundCell As Range
Dim FirstAddress As String
Set wks = ActiveSheet
With wks
'clear any existing formatting that was used
Application.FindFormat.Clear
'just the merged cells
With Application.FindFormat
.MergeCells = True
End With
Set FoundCell = .Cells.Find(What:="", _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=True)
If FoundCell Is Nothing Then
'not one unlocked cell!
Else
'keep track of where the first one was, so we can quit
'when we find this again.
FirstAddress = FoundCell.Address
'start building the range of unlocked cells
Set myMergedCells = FoundCell
Do
Set FoundCell = .Cells.Find(What:="", _
After:=FoundCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=True)
If FoundCell Is Nothing Then
Exit Do
End If
If FoundCell.Address = FirstAddress Then
Exit Do
End If
'add to the growing range
Set myMergedCells = Union(myMergedCells, FoundCell)
Loop
End If
End With
If myMergedCells Is Nothing Then
MsgBox "None found!"
Else
Application.Goto myMergedCells ', scroll:=True
MsgBox myMergedCells.Address
End If
End Sub