ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extracting conditional format conditions for cell (https://www.excelbanter.com/excel-programming/377931-extracting-conditional-format-conditions-cell.html)

Barb Reinhardt

Extracting conditional format conditions for cell
 
I have a range r (which is only one cell) and I'd like to programmatically
determine if there is a conditional format condition with a formula.

To add a conditional format, I do this:

R.FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2=1"

What I want to know is if there is a formula?

Thanks

Francois via OfficeKB.com

Extracting conditional format conditions for cell
 
Barb Reinhardt wrote:
I have a range r (which is only one cell) and I'd like to programmatically
determine if there is a conditional format condition with a formula.

To add a conditional format, I do this:

R.FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2=1"

What I want to know is if there is a formula?

Thanks



Something like:-
Range("A1:A1000").Select
Cells.SpecialCells(xlCellTypeAllFormatConditions). Select

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1


Gary''s Student

Extracting conditional format conditions for cell
 
Select a cell and run this:


Sub iscondition()
On Error GoTo nothere
s = Selection.FormatConditions(1).Formula1
MsgBox ("it is there")
Exit Sub
nothe
MsgBox ("not there")
End Sub
--
Gary's Student


"Barb Reinhardt" wrote:

I have a range r (which is only one cell) and I'd like to programmatically
determine if there is a conditional format condition with a formula.

To add a conditional format, I do this:

R.FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2=1"

What I want to know is if there is a formula?

Thanks


Bob Phillips

Extracting conditional format conditions for cell
 
'---------------------------------------------------------------------
Public Function IsCF(rng As Range) As Boolean
'---------------------------------------------------------------------
Set rng = rng(1, 1)
IsCF = rng.FormatConditions.Count 0
End Function

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Barb Reinhardt" wrote in message
...
I have a range r (which is only one cell) and I'd like to programmatically
determine if there is a conditional format condition with a formula.

To add a conditional format, I do this:

R.FormatConditions.Add Type:=xlExpression,

Formula1:="=MOD(ROW(),2=1"

What I want to know is if there is a formula?

Thanks





All times are GMT +1. The time now is 07:34 AM.

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