Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Can Excel cell formatting be included in an IF statement?
We run a macro that selects duplicates and formats with background with a
color. We need to include that cell formatting in an IF statement. Can it be done and, if so, what would be the syntax? |
#2
|
|||
|
|||
No, but you can add conditional formatting to the cell, and test the value
there and set the format accordingly. -- HTH Bob Phillips "neeses" wrote in message ... We run a macro that selects duplicates and formats with background with a color. We need to include that cell formatting in an IF statement. Can it be done and, if so, what would be the syntax? |
#3
|
|||
|
|||
Bob,
Thanks for the reply. My next question is: Is there some way to delete cells with the formatted background, either through a macro or some function? "Bob Phillips" wrote: No, but you can add conditional formatting to the cell, and test the value there and set the format accordingly. -- HTH Bob Phillips "neeses" wrote in message ... We run a macro that selects duplicates and formats with background with a color. We need to include that cell formatting in an IF statement. Can it be done and, if so, what would be the syntax? |
#4
|
|||
|
|||
Do you mean CF formats
Sub FCs() Dim cell As Range Dim fc As FormatCondition For Each cell In ActiveSheet.UsedRange If cell.FormatConditions.Count 0 Then For Each fc In cell.FormatConditions fc.Delete Next fc End If Next cell End Sub or ordinary formats Dim cell As Range For Each cell In ActiveSheet.UsedRange cell.ClearFormats Next cell -- HTH Bob Phillips "neeses" wrote in message ... Bob, Thanks for the reply. My next question is: Is there some way to delete cells with the formatted background, either through a macro or some function? "Bob Phillips" wrote: No, but you can add conditional formatting to the cell, and test the value there and set the format accordingly. -- HTH Bob Phillips "neeses" wrote in message ... We run a macro that selects duplicates and formats with background with a color. We need to include that cell formatting in an IF statement. Can it be done and, if so, what would be the syntax? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Too many different cell formats | Excel Discussion (Misc queries) | |||
retrieve cell formatting with IF(HLOOKUP) formula | Excel Worksheet Functions | |||
Excel automatically changes the formatting of the cell to "Time" | Excel Discussion (Misc queries) | |||
Conditional formatting not available in Excel | Excel Discussion (Misc queries) | |||
GET.CELL | Excel Worksheet Functions |