Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VSTO: ConditionalFormatting not working Bob Sullentrup Excel Programming 0 November 4th 05 04:41 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"