Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default how can I conditionally change font color, or background color?

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default how can I conditionally change font color, or background color?

Just use conditional formatting (FormatConditional Formatting) and set the
font colour to red if the cell value is Fail Msg, Blue if Pass Msg.

--
HTH

Bob Phillips

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

"MOHA" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 176
Default how can I conditionally change font color, or background color?

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

--
Regards,
Dave


"MOHA" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default how can I conditionally change font color, or background color?


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 =


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=573849

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
Button or key to conditionally change text foreground color? Alex New Users to Excel 1 February 27th 06 09:40 PM
Button or key to conditionally change text foreground color? Bob Phillips New Users to Excel 0 February 27th 06 07:27 PM
Event Macro adjustment needed - need to change font color also nick s Excel Worksheet Functions 2 November 28th 05 05:50 PM
change font color of cell based on critera amrezzat Excel Worksheet Functions 1 November 20th 05 03:54 PM
Change Font Color Based on Classification sip8316 Excel Discussion (Misc queries) 3 June 2nd 05 07:15 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"