Thread: Merged cells
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Sandy Mann Sandy Mann is offline
external usenet poster
 
Posts: 2,345
Default Merged cells

There may be better ways, especially in later versions in than my XL97 but
assuming that the last used row is Row 250 then you could use:

Sub Merger()
LastRow = 250
Application.ScreenUpdating = False
For x = 1 To Columns.Count
Columns(x).Select
If Selection.Columns.Count 1 Then
For y = 1 To LastRow
Cells(y, x).Select
If Selection.Columns.Count 1 Then
Application.ScreenUpdating = True
Cells(y, x).Select
MsgBox "Merged cell " & Cells(y,
x).Address
GoTo GetOut
Application.ScreenUpdating = False
End If
Next y
End If
Next x
GetOut:
Application.ScreenUpdating = True
End Sub

The code will stop after you dismiss the messagebox so that you can unmerge
the cells then run the code again.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"GARY" wrote in message
oups.com...
When trying to sort a worksheet, a box is displayed saying "This
operation requires the merged cells to be identically sized".

(The current worksheet contains data copied from a number of other
worksheets)

In the current worksheet, how do I find which cell(s) are the merged
cells?