+ Reply to Thread
Results 1 to 2 of 2

Merged Cells

  1. #1
    TerryTutor
    Guest

    Merged Cells

    Is there some way to find which cells are merged without having to look at
    each cell? Sometimes I want to move or delete cells and it says" cannot move
    part of merged cell" or something like that, but it does not show me which
    cell is merged.


  2. #2
    Norman Jones
    Guest

    Re: Merged Cells

    Hi Terry,

    I am not aware of any inbuilt method for displaying merged cells.

    One possibility would be to use a macro like the following which will select
    (and therefore temporarily highlight) merged cells. As written, the macro
    will select all merged cells in the selected range. If the selection
    comprises a single cell, all merged cells will be selected. If no merged
    cells are found, a message will put up to confirm this.

    Sub ShowMergedCells()
    Dim rng As Range
    Dim rCell As Range
    Dim RngMerged As Range

    If Selection.Count > 1 Then
    Set rng = Selection
    Else
    Set rng = Selection.Parent.UsedRange
    End If

    For Each rCell In rng

    If rCell.MergeCells Then
    If Not RngMerged Is Nothing Then
    Set RngMerged = Union(RngMerged, rCell)
    Else
    Set RngMerged = rCell
    End If
    End If
    Next

    If Not RngMerged Is Nothing Then
    RngMerged.Select
    Else
    MsgBox "No merged cells found in selected range!"
    End If

    End Sub

    You could perhaps assign the macro to a toolbar button.

    If you are new to macros, visit David McRitchie's introductory notes at:

    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    ---
    Regards,
    Norman



    "TerryTutor" <[email protected]> wrote in message
    news:[email protected]...
    > Is there some way to find which cells are merged without having to look at
    > each cell? Sometimes I want to move or delete cells and it says" cannot
    > move
    > part of merged cell" or something like that, but it does not show me which
    > cell is merged.
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1