ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing font color based on positive or negative number (https://www.excelbanter.com/excel-programming/403388-changing-font-color-based-positive-negative-number.html)

Joe

Changing font color based on positive or negative number
 
Hello everyone,

I'm attempting to make a budget in Excel and would like to format a cell to
turn bold and red when the sum equals a negative number and for the cell to
turn bold and black when the sum equals a positive number. I believe there
is a way to do it but I'm not sure how to go about doing so. Any help you
can provide would be great. Thanks!

Per Jessen[_2_]

Changing font color based on positive or negative number
 
Hi Joe

Use conditional formatting. Find it in the format menu.

Happy New Year!
Per

On 30 Dec., 05:24, Joe wrote:
Hello everyone,

I'm attempting to make a budget in Excel and would like to format a cell to
turn bold and red when the sum equals a negative number and for the cell to
turn bold and black when the sum equals a positive number. *I believe there
is a way to do it but I'm not sure how to go about doing so. *Any help you
can provide would be great. *Thanks!



Peter T

Changing font color based on positive or negative number
 
You can use NumberFormat. The -ve format is between the 1st & {optional) 2nd
semi-colons. Look at the examples in Custom, or simply
"General;[Red]-General" without the quotes.

Programatically,

dim rng as Range
dim sNumFmt as string

sNumFmt = "#,##0.00;[Red]-#,##0.00;[Blue]""zero"""
set rng = Selection
rng.NumberFormat = sNumFmt

Regards,
Peter T

"Joe" wrote in message
...
Hello everyone,

I'm attempting to make a budget in Excel and would like to format a cell

to
turn bold and red when the sum equals a negative number and for the cell

to
turn bold and black when the sum equals a positive number. I believe

there
is a way to do it but I'm not sure how to go about doing so. Any help you
can provide would be great. Thanks!





All times are GMT +1. The time now is 05:30 AM.

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