Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default code for conditional formats

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


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default code for conditional formats

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 "greg"
wrote in message
...
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
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
Conditional Formats, how to scroll and view all formats? Bill E Excel Worksheet Functions 0 May 12th 10 07:58 PM
Conditional formats- paste special formats? jcarney Excel Discussion (Misc queries) 1 November 1st 07 06:37 PM
paste conditional formats as formats leo Excel Discussion (Misc queries) 2 July 5th 07 10:06 AM
More than 3 conditional formats? Ltat42a Excel Discussion (Misc queries) 12 January 6th 06 11:26 AM
How do I add more Conditional Formats? Saint Excel Discussion (Misc queries) 2 April 26th 05 07:30 PM


All times are GMT +1. The time now is 03:36 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"