ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Highlighted cell color (https://www.excelbanter.com/excel-worksheet-functions/210996-highlighted-cell-color.html)

JP[_6_]

Highlighted cell color
 
How can I change the highlighted color for a range of selected cells?
--
JP

Don Guillett

Highlighted cell color
 
Right click sheet tabview codecopy paste this
Now whatever selection you make will be colored with number 6

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
With Target
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 6 '35
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JP" wrote in message
...
How can I change the highlighted color for a range of selected cells?
--
JP




All times are GMT +1. The time now is 08:33 AM.

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