Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
neeses
 
Posts: n/a
Default 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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
neeses
 
Posts: n/a
Default

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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
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
Too many different cell formats reb24 Excel Discussion (Misc queries) 4 September 7th 05 03:25 PM
retrieve cell formatting with IF(HLOOKUP) formula useR Excel Worksheet Functions 2 August 3rd 05 06:55 PM
Excel automatically changes the formatting of the cell to "Time" Sam Excel Discussion (Misc queries) 3 July 24th 05 08:51 PM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 04:33 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 08:16 PM


All times are GMT +1. The time now is 09:20 AM.

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"