Merged cell color issue

amauer

New Member
Joined
May 11, 2012
Messages
33
I have a macro that changes the color of a merged cell once data has been entered, but it only changes the main cell, but the hidden merged portion of the merged cell ( A12 and A13 are merged, A12 color will change, but not A13). I have the macro set to change active cell once data is entered, so the hidden portion is not changing. My issue is; I have a macro that checks for cells with the incomplete color, so the macro finds the hidden portions of the merged cells and returns an answer that has several incomplete cells.

If I manually change the color, the hidden cells do change, but my macro does not change the hidden portions.

Is there a way to get all merged portions of the cells to change color?

Thanks!

sub for cell (cell click event):

myValue = InputBox("What is the MIX number?")
ActiveCell.Value = myValue
ActiveCell.Interior.ColorIndex = 4

sub for checking cell color (assigned to a button, once the sheet is complete):

For Each cell In myRange
If cell.RowHeight <> 0 Then
If cell.Interior.Color = 15773696 Then
a = a + 1
ElseIf cell.Interior.Color = 65535 Then
y = y + 1

ElseIf cell.Interior.Color = 10498160 Then
x = x + 1

End If

End If

Next cell
Sheets("Validation").Cells(13, 1) = a
Sheets("Validation").Cells(12, 1) = y
Sheets("Validation").Cells(14, 1) = x
 
"When two or more cells are merged, they shouldn't be hidden. They should all be visible as one larger cell."

The color of A13 is hidden from view. If you use .ColorIndex on A12/A13 (merged), then unmerge the cells, A13 did not get the color change. If I use .color (like using Fill in the ribbon) on them, then both got the color change request.

I did not realize there was a difference between the two way.

When my macro was looking for specific colors, it would find that A13 was still the original color and not green (like A12 merged with A13), but I could not see the color of A13 because it was hidden.
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,215,438
Messages
6,124,873
Members
449,192
Latest member
MoonDancer

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