PC Review


Reply
Thread Tools Rate Thread

code for conditional formats

 
 
greg
Guest
Posts: n/a
 
      21st May 2007
Hello,
I am seeing some wierd things. I am creating VBA code. where I make 1
pass. and add in a bunch of generic conditional formats. then I run a
second pass and put in the business logic. So I modify the conditional
formats that i created before. But it does not seem to really get updated.
If i pause the code. and open the conditional formats dialog. then run the
code. it seems to work fine.

has anyone seen this bug?

my modify code is like this:
objFormatConditions.Modify xlExpression, Formula1:="=UPPER(" & strTempString
& ") <> ""X"" "

thanks for any help


 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      21st May 2007
Maybe? this from vba help
Modify Method (FormatCondition Object)
Modifies an existing conditional format.

expression.Modify(Type, Operator, Formula1, Formula2)

expression Required. An expression that returns a FormatCondition object.

Type Required XlFormatCondition. Specifies whether the conditional format
is based on a cell value or an expression.

XlFormatCondition can be one of these XlFormatCondition constants.
xlCellValue
xlExpression

Operator Optional XlFormatConditionOperator. The conditional format
operator.

XlFormatConditionOperator can be one of these
XlFormatConditionOperator constants.
xlBetween
xlEqual
xlGreater

xlGreaterEqual

xlLess

xlLessEqual

xlNotBetween

xlNotEqual

If Type, is xlExpression, the Operator argument is ignored.


Formula1 Optional Variant. The value or expression associated with the
conditional format. Can be a constant value, a string value, a cell
reference, or a formula.

Formula2 Optional Variant. The value or expression associated with the
conditional format. Can be a constant value, a string value, a cell
reference, or a formula..

Example
This example modifies an existing conditional format for cells E1:E10.

Worksheets(1).Range("e1:e10").FormatConditions(1) _
.Modify xlCellValue, xlLess, "=$a$1"
-- Don GuillettSalesAid (E-Mail Removed)"greg"
<(E-Mail Removed)> wrote in message
news:e7li0k%(E-Mail Removed)...
> Hello,
> I am seeing some wierd things. I am creating VBA code. where I make 1
> pass. and add in a bunch of generic conditional formats. then I run a
> second pass and put in the business logic. So I modify the conditional
> formats that i created before. But it does not seem to really get
> updated.
> If i pause the code. and open the conditional formats dialog. then run
> the
> code. it seems to work fine.
>
> has anyone seen this bug?
>
> my modify code is like this:
> objFormatConditions.Modify xlExpression, Formula1:="=UPPER(" &
> strTempString
> & ") <> ""X"" "
>
> thanks for any help
>
>


 
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
Conditional Formats, how to scroll and view all formats? Bill E Microsoft Excel Worksheet Functions 0 12th May 2010 07:58 PM
Conditional formats- paste special formats? =?Utf-8?B?amNhcm5leQ==?= Microsoft Excel Misc 1 1st Nov 2007 06:37 PM
paste conditional formats as formats =?Utf-8?B?bGVv?= Microsoft Excel Misc 2 5th Jul 2007 10:06 AM
code for conditional formats greg Microsoft Excel Programming 1 21st May 2007 10:42 PM
Open Source C# code for file formats in HTML, Word, lit (unprotected), and other formats? news.austin.rr.com Microsoft Dot NET Compact Framework 3 17th Jan 2005 04:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:18 PM.