Thread: Merge
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Jithu Jithu is offline
external usenet poster
 
Posts: 36
Default Merge

Thanks a lot Dave. It saved one day of work for me

"Dave Peterson" wrote:

You can select a small range and then format|Cells|alignment tab and look at the
Merge box. If it's clear, there are no merged cells in the selection.

If there are, you divide your range into two parts and look at each part. Keep
dividing until you find all the cells that are merged.

Or you could use a macro:

Option Explicit
Sub testme()

Dim rptWks As Worksheet
Dim wks As Worksheet
Dim oRow As Long
Dim iCtr As Long
Dim myCell As Range

Set wks = Worksheets("sheet1")

Set rptWks = Worksheets.Add
rptWks.Range("a1").Value = wks.Name

oRow = 1
For Each myCell In wks.UsedRange.Cells
If myCell.MergeArea.Cells.Count 1 Then
If myCell.MergeArea.Cells(1).Address = myCell.Address Then
oRow = oRow + 1
rptWks.Cells(oRow, 1).Value = myCell.MergeArea.Address
End If
End If
Next myCell

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Jithu wrote:

How to find a merged cell in a work sheet full of data?


--

Dave Peterson