Solved

Find Merged Cells in Excel Range and Unmerge

Posted on 2011-03-14
2
778 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
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 in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now