Solved

Find Merged Cells in Excel Range and Unmerge

Posted on 2011-03-14
2
786 Views
Last Modified: 2012-05-11
Hi,
I have some code which does a lot of calculation and generates a matrix as an output. As part of this, each coordinate in the matrix will grow or shrink depending on the number of values within the coordinate (if that makes sense!). For example, The coordinate corresponding to 3C may contain 6 values each of which are held in a separate cell. This then means that anything in the C row will always have at least 6 cells.
That's the bit that I've got working. What I'm struggling with is tidying up the titles. For each row I need to place a title which will be merged down across the cells; so, to use the previous example, if the 3C coordinate values are held in the range "H12:H17" I want to have a title of "C - Solid Performer" which will be merged in the range "D12:D17".
As it happens, I've also got this to work and I can get the titles to merge correctly. However, here is the problem:
If I re-run my function and the number of values in the coordinates differs (which it almost certainly will for each analysis), then the merged titles do not work as the previous merged cells have not cleared. The question is:
1. How do I find merged cells in a range (bearing in mind the range itself will not be static on each running of the code;
2. How do I unmerge the cells when they are found?
0
Comment
Question by:Karl_mark
2 Comments
 
LVL 9

Accepted Solution

by:
McOz earned 500 total points
ID: 35130445
How about simply unmerging ALL cells before re-running the function?

 
Cells.Unmerge

Open in new window


Cheers
0
 

Author Closing Comment

by:Karl_mark
ID: 35259628
Simple and effective. Thanks!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Batch Numbering 6 30
copy same as above data 18 35
Response times in Excel 18 40
simple excel formula 4 13
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question