Need help with merge cells in a macro

A

Armando

Hello all,

I am writing a macro that needs to cycle through all the
active rows with in the active sheet, and filter out all
the rows that contain a date that is not in the specified
paramaters.

My problem is that some of these rows have merged cells
and when I lter out a row, it leaves behind the ones that
were merged with it. I need all the rows to disappear.

I was thinking that I could check to see if the row was
merged first and capture the address of the merged
fields. Then I would unmerge the rows and populate the
newly unmerged cells with what was in the original cell.

I can check if the cells are merged by:

If Range("myRange").MergeCells then
Set merge = Range("myRange").MergeArea
addr = merge.address
val = Range("myRange").Value

This is as far as I know.
How can I assign the value of the merged cells to all the
cells once they are unmerged?
Please help.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top