ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ConditionalFormatting help (https://www.excelbanter.com/excel-programming/428453-conditionalformatting-help.html)

Ayo

ConditionalFormatting help
 
I am looking for a way to write conditional formatting in VBA. Below is my
code which works perfect but, there is a twist.

ws.Range("E4:AN" & sitelistStartingCell - 1).FormatConditions(1).Modify
xlCellValue, xlEqual, "Projected"

I also need to apply the same format if the cell value is "Past Due". Also,
if the cell directly next a cell containing "Projected" or "Past Due" has a
date less than or equal to "5/20/2009" I want to apply the same format
condition.
Any help will be greatly appreciated.
Thanks.


Bernie Deitrick

ConditionalFormatting help
 
Ayo,

Something like:

ws.Range("E4:AN" & sitelistStartingCell - 1).FormatConditions(1).Modify
xlExpression, Formula1:= _
"=AND(OR(E4 = ""Projected"", E4 = ""Past Due""),F4<=TODAY()+7)"

HTH,
Bernie
MS Excel MVP


"Ayo" wrote in message
...
I am looking for a way to write conditional formatting in VBA. Below is my
code which works perfect but, there is a twist.

ws.Range("E4:AN" & sitelistStartingCell - 1).FormatConditions(1).Modify
xlCellValue, xlEqual, "Projected"

I also need to apply the same format if the cell value is "Past Due".
Also,
if the cell directly next a cell containing "Projected" or "Past Due" has
a
date less than or equal to "5/20/2009" I want to apply the same format
condition.
Any help will be greatly appreciated.
Thanks.




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

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