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

Where have you been? I spent 2 hours trying to check for Merged Cells in
code because I did not that the keyword was MergeCells not MergedCells <g

--

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


with @tiscali.co.uk


"Gary''s Student" wrote in message
...
Sub findmerge()
Dim r As Range
Dim rr As Range
For Each r In ActiveSheet.UsedRange
If r.MergeCells = True Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
If rr Is Nothing Then
Else
rr.Select
End If


This will find all merged cells in the worksheet.
--
Gary''s Student - gsnu200719


"GARY" wrote:

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?