Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / August 2006

Tip: Looking for answers? Try searching our database.

how can I conditionally change font color, or background color?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MOHA - 21 Aug 2006 18:43 GMT
In a test procedure, I end up with a column where I use CountIf to determine
if there are any F (for Fail) characters in the column [=If((CountIf(M25:M95,
"F")=0
("Pass Msg","Fail Msg")).   This works OK.
I would like to be able to print the message in red font if it fails, and
blue font if it passes.
I have created a macro that will change the font color, and I can write VBA
code to do it. I have not figured out how to get the macro or the VBA Code to
run automatically following the pass/fail test.
Can it be done?
Security level set at Mediun, I have created a self signed certificate.
Bob Phillips - 21 Aug 2006 18:49 GMT
Just use conditional formatting (Format>Conditional Formatting) and set the
font  colour to red if the cell value is Fail Msg, Blue if Pass Msg.

Signature

HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

> In a test procedure, I end up with a column where I use CountIf to determine
> if there are any F (for Fail) characters in the column [=If((CountIf(M25:M95,
[quoted text clipped - 7 lines]
> Can it be done?
> Security level set at Mediun, I have created a self signed certificate.
David Billigmeier - 21 Aug 2006 18:54 GMT
Starting in M25, follow these steps.  Then, copy formatting down to M95:

<Format>
<Conditional Formatting..."
Choose "Formula Is"
Enter =M25="F", choose a red font
Click "Add >>"
Choose "Formula Is" again
Enter =M25="P", choose a blue font

Signature

Regards,
Dave

> In a test procedure, I end up with a column where I use CountIf to determine
> if there are any F (for Fail) characters in the column [=If((CountIf(M25:M95,
[quoted text clipped - 7 lines]
> Can it be done?
> Security level set at Mediun, I have created a self signed certificate.
Bearacade - 21 Aug 2006 18:57 GMT
Why not just use Conditional Format?

To do the VBA:

Range("").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue
Operator:=xlEqual, Formula1:="=""Pass Msg"""
Selection.FormatConditions(1).Font.ColorIndex =
Selection.FormatConditions(1).Interior.ColorIndex

--
Bearacad
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.