#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 117
Default Merged cells

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?

  #2   Report Post  
Posted to microsoft.public.excel.misc
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?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Merged cells

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?


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Merged cells

I didn't know either. I just merged two cells with the Recorder on and
looked at the result.
--
Gary''s Student - gsnu200719


"Sandy Mann" wrote:

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?







  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Merged cells

Posted previously for Excel 2003

Try This:

Use CTRL - F to open a Find And Replace Dialog Box
Click the options button
Make sure that the Find What Box is empty
Click the Format Button
Go to the Alignment Tab
Remove ticks from Wrap Text and Shrink To Fit
They will be greyed out but a second click will remove the tick
Click the Merge Cells to remove the grey shadow and leave the tick in a
clear box
OK back to the Find And Replace Screen
Click Find All Button
All merged cells are shown in the lower pane
Click on each one to go to them one at a time

Hope this helps!! Enjoy


--
A White

---------------------------------------------------------------------------
All Outgoing Mail Scanned By Norton Antivirus 2003
---------------------------------------------------------------------------
"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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cells are Merged. How to know where to where??? musa.biralo New Users to Excel 2 November 5th 06 05:17 PM
Merged Cells grok Excel Discussion (Misc queries) 1 October 25th 06 07:18 PM
how do i link merged cells to a merged cell in another worksheet. ibbm Excel Worksheet Functions 3 April 27th 06 11:40 PM
Merged cells Rena Excel Discussion (Misc queries) 4 April 11th 06 01:10 PM
Sorting merged cellsHow do I sort merged cells not identically siz Laval Excel Worksheet Functions 1 November 3rd 04 09:40 PM


All times are GMT +1. The time now is 10:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"