Automatically change number color based on +/- within text string in one cell

RP04

New Member
Joined
Dec 16, 2019
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hello!

I have a tried multiple different solutions but have not been able to make this work yet (including trying to write a VBA code)

I am trying to change the color or negative numbers to red inside a cell that also contains text/other formulas. This was the latest and what I thought would have been the simplest solution.

="Example ABC " & Text(-3000,(#,##0.00_);(#,##0.00))
(goal is to change -3000 to red and also put a comma in)

*reason I cannot just highlight the negative numbers and change to red it that there are hundred of lines with text in the formula, too manual and chance of human error.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi & welcome to MrExcel.
If the cell contains a formula, you cannot (afaik) change the font colour for part of the cell
 
Upvote 0
Hi & welcome to MrExcel.
If the cell contains a formula, you cannot (afaik) change the font colour for part of the cell
Hello - What if I copy/paste as values but it is all still inside one cell (text and numbers)?
 
Upvote 0
Then you can format it with a macro.
Would always be just -3000 that needs to be changed to a red font?
 
Upvote 0
Then you can format it with a macro.
Would always be just -3000 that needs to be changed to a red font?

It would be different numbers in different cells every day in various formats (-XX%, -XX.X ppts). I tried creating a macro but was having difficulting getting it to work on different numbers instead of just the same numbers
 
Upvote 0
Can you post some examples of the data in the cells, showing what you want highlighted.
Also what are the cell ranges?
 
Upvote 0
Can you post some examples of the data in the cells, showing what you want highlighted.
Also what are the cell ranges?

Cell ranges between E6:BE22. See images below
 

Attachments

  • Ex1.PNG
    Ex1.PNG
    8 KB · Views: 10
  • Ex2.PNG
    Ex2.PNG
    8.5 KB · Views: 11
Upvote 0
Is there any reason why the value in A1 is not red, as that is also a negative value?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top