+ Reply to Thread
Results 1 to 3 of 3

How to check the cell merge or not

  1. #1
    Valued Forum Contributor
    Join Date
    05-07-2014
    Location
    India
    MS-Off Ver
    MS Office 365
    Posts
    313

    How to check the cell merge or not

    Hello Everyone,

    I have wrote a VBA code to check in a range cells are merged or not, but the code is not working please check once and correct me where is I am wrong.


    Function ContainsMergedCells(rng As Range)
    Dim cell As Range
    For Each cell In rng
    If cell.MergeCells Then
    ContainsMergedCells = True
    Exit Function
    End If
    Next cell
    ContainsMergedCells = False
    End Function


    Thanks in advance

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,043

    Re: How to check the cell merge or not

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Never use Merged Cells in Excel

  3. #3
    Valued Forum Contributor
    Join Date
    05-07-2014
    Location
    India
    MS-Off Ver
    MS Office 365
    Posts
    313

    Re: How to check the cell merge or not

    Hello Everyone,

    I have wrote a VBA code to check in a range cells are merged or not, but the code is not working please check once and correct me where is I am wrong.


    Please Login or Register  to view this content.
    Thanks in advance
    Last edited by Nisha Dhawan; 02-03-2015 at 07:59 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Check & Merge Multiple data
    By shiven.k in forum Excel General
    Replies: 13
    Last Post: 09-11-2013, 07:15 AM
  2. Macro to check lenght of characters and merge cells
    By hit1234 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-08-2013, 10:46 AM
  3. Mail merge based on check boxes
    By dans123 in forum Access Tables & Databases
    Replies: 1
    Last Post: 09-17-2012, 08:58 AM
  4. check value - merge and count
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-21-2009, 06:17 PM
  5. merge and reset a merge based on cell content
    By salkovsg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2007, 07:08 PM

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