ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Formatting a range of cells (https://www.excelbanter.com/excel-programming/297643-re-conditional-formatting-range-cells.html)

Bernie Deitrick

Conditional Formatting a range of cells
 
Gregory,

Perhaps something like this, which will color cells in A1:B10 less than 8000
or greater than 9000 Red.

Dim myCell As Range

For Each myCell In Range("A1:B10")
If myCell.Value 9000 Or myCell.Value < 8000 Then
myCell.Interior.ColorIndex = 3
End If
Next myCell

HTH,
Bernie
MS Excel MVP

"Gregory" wrote in message
...
I am trying to change the background color of cells where the value is <

or a certain number. Is there a simple way to do this programatically?
Thanks in advance for any help




All times are GMT +1. The time now is 02:29 PM.

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