ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   color of text (https://www.excelbanter.com/excel-discussion-misc-queries/132565-color-text.html)

Tammy

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?



Ron Rosenfeld

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

Gary''s Student

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?



Vergel Adriano

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?



Gord Dibben

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?




All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com