Need help regarding mixed rows of merged and unmerged cells

TGarrett

New Member
Joined
Oct 5, 2015
Messages
20
First off, I know, merged cells are the Devil and should be avoided at all costs. :devilish: That said, I have no choice but to deal with them in this spreadsheet. I get a daily Excel product, which is generated from a third party system. I then have to make multiple formatting (color code, hide columns, make headers/footers) changes, populate the file with results. The cells must remain merged/unmerged as there were originally or when I upload the file back into the system, it will be rejected. I am trying to make a macro to perform all of the formatting. There are a couple hundred rows of data, some rows are unmerged across all of the columns, but most are 2-4 rows of cells merged in each of the columns, except for 3, which must remain unmerged. I have two questions that are driving me crazy trying to resolve:

1. I have written the conditional formatting rules to color the rows based the value of either of two columns. These columns are ones that may or may not contain merged cells. When the formatting runs on a row with merged cells, only the top row of cells in the columns with unmerged cells is colored, the subsequent rows below within the merged row remain unchanged. I understand this is because the merged row registers only as the top cell in the merged range and that the remaining merged cells have blank values. Is there a conditional formatting formula or VBA code that I can use to get the remaining cells within the row to look at the merged source cell and change.

2. My other issue is with merged cell rows and page breaks. I there any way to adjust the automatic page breaks via VBA so they are not placed in the middle of a merged row? I found a great script to use for Word, but absolutely nothing for Excel. I have seen the question asked a lot but no one seems to have a solution. I am hoping someone may have figured out a viable work around.

I had built a sample file to give a better visual idea of what I'm talking about, but unfortunately I don't seem to have permissions to attach a file. Thanks for any help.

Tom
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,215,172
Messages
6,123,447
Members
449,100
Latest member
sktz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top