ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I change a merged Cells background color (https://www.excelbanter.com/excel-programming/375933-how-do-i-change-merged-cells-background-color.html)

rich

How do I change a merged Cells background color
 
Hi,

I have wrote a script that validates the values of different cells.
When it detects a problem it changes the background colour of the
offending cell.

To reset the background colour back to it's original colour I've added
this script to the worksheet:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Target.Interior
If .ColorIndex = 7 Then
.ColorIndex = 36
End If
End With
End Sub

This works on the cells that aren't merged but doesn't on those that
are. How do I change the color ot the merged cells?

Thanks in advance

Rich



All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com