PC Review


Reply
Thread Tools Rate Thread

ConditionalFormatting help

 
 
Ayo
Guest
Posts: n/a
 
      13th May 2009
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 With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      14th May 2009
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" <(E-Mail Removed)> wrote in message
news:6FD3AA8F-E161-415B-B70D-(E-Mail Removed)...
>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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VSTO: ConditionalFormatting not working =?Utf-8?B?Qm9iIFN1bGxlbnRydXA=?= Microsoft Excel Programming 0 4th Nov 2005 04:41 PM


Features
 

Advertising
 

Newsgroups
 


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