#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 145
Default color of text

Is there a way (macro or vb code) to make a text appear a certain color. For
example, if the number in the cells a1:aa65000 50 but <50000 then color them
red?


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default color of text

On Tue, 27 Feb 2007 12:23:06 -0800, Tammy
wrote:

Is there a way (macro or vb code) to make a text appear a certain color. For
example, if the number in the cells a1:aa65000 50 but <50000 then color them
red?


Look at Conditional Formatting.

It can be invoked either directly from the Format menu in Excel, or used within
VBA.
--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default color of text

You can use Conditional Formatting to set the background color or font color
based upon the value in the cell. See:

http://www.contextures.com/xlCondFormat01.html

--
Gary''s Student
gsnu200708


"Tammy" wrote:

Is there a way (macro or vb code) to make a text appear a certain color. For
example, if the number in the cells a1:aa65000 50 but <50000 then color them
red?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default color of text

To change the font color in VBA, you use something like this

Range("A1").Font.Color = vbRed

But this is something you can do without using VBA. You can just use
Conditional Formatting.

1. Select the range you want to apply conditional formatting to.
2. Format-Conditional Formatting
3. Enter Condition 1 as cell value is between 51 and 49999
4. Click on Format button
5. Pick Red color for the font. click ok to close format cells dialog.
6. Click ok to close Contional Formatting dialog.


"Tammy" wrote:

Is there a way (macro or vb code) to make a text appear a certain color. For
example, if the number in the cells a1:aa65000 50 but <50000 then color them
red?


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default color of text

Tammy

What do you want if number is exactly 50 or 50000?

FormatConditional FormattingCell Value is: between 50(or 50.1) and 50000(or
49999.9) depending upon the answer to first question.


Gord Dibben MS Excel MVP


On Tue, 27 Feb 2007 12:23:06 -0800, Tammy
wrote:

Is there a way (macro or vb code) to make a text appear a certain color. For
example, if the number in the cells a1:aa65000 50 but <50000 then color them
red?


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
Can't format cell color/text color in Office Excel 2003 in fil Tony S Excel Discussion (Misc queries) 1 December 21st 07 01:41 PM
Cond. format text color based on another's text color manxman Excel Discussion (Misc queries) 3 August 31st 06 06:27 PM
Cell Fill Color and text color - changes for recipient Shadowman13 Excel Discussion (Misc queries) 0 March 8th 06 11:32 PM
Can't format cell color/text color in Office Excel 2003 in files . albertaman Excel Discussion (Misc queries) 0 February 16th 06 03:56 AM
Shortcut for FILL COLOR and COLOR TEXT UABCSA Excel Discussion (Misc queries) 1 May 27th 05 10:01 PM


All times are GMT +1. The time now is 08:12 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"