Is it possible to have 2 different colors for a numeric cell?

AshrafFouad

New Member
Joined
Feb 2, 2020
Messages
5
Office Version
365
Platform
Windows
Hi,
I have a numeric cell formatted as (#,##0 "Meters") to display --> e.g. 112 Meters
Is it possible to display the text "Meters" in a different color? --> e.g. 112 Meters

Thank you.
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

VBE313

Well-known Member
Joined
Mar 22, 2019
Messages
508
Office Version
365
Platform
Windows
 

AshrafFouad

New Member
Joined
Feb 2, 2020
Messages
5
Office Version
365
Platform
Windows
Thanks for responding.
It did change both (Number & text) to the red color.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,524
Office Version
365
Platform
Windows
As was pointed out by VBE313, it is not possible to do what you are asking for.
 

AshrafFouad

New Member
Joined
Feb 2, 2020
Messages
5
Office Version
365
Platform
Windows
Sorry, the previous reply was not for you and I didn't find an edit button to my post.
For such post you shared, if the cell content is text, it is possible to have many colors in one cell, but I'm looking for many colors for a numeric field.

 

Attachments

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,524
Office Version
365
Platform
Windows
Please see post#6. ;)
 

AshrafFouad

New Member
Joined
Feb 2, 2020
Messages
5
Office Version
365
Platform
Windows
As was pointed out by VBE313, it is not possible to do what you are asking for.
Thanks for responding & sorry for being late.
I found a solution, it is a workaround but the result is satisfactory.
In Microsoft community & through VBA they merge 2 cells (one numeric & the other is text in my case) with different colors in one cell with the same colors.
The displayed result after modifying the code:
Capture.JPG


VBA Code:
Sub merge()
'Starts on the first cell
Value1 = ActiveCell.Value
Color1 = ActiveCell.Font.Color
Len1 = Len(Value1)

Value2 = "Meter"
Color2 = 1256897
Len2 = 5

ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Value = Value1 & " " & Value2
With ActiveCell.Characters(Start:=1, Length:=Len1).Font
    .Color = Color1
End With
With ActiveCell.Characters(Start:=Len1 + 2, Length:=Len2).Font
    .Color = Color2
End With
ActiveCell.Offset(1, -1).Range("A1").Select
End Sub
The only cons of this method, it is not updating automatically the "displayed text" if I changed the "value"
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,524
Office Version
365
Platform
Windows
Glad you sorted it & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,098,858
Messages
5,465,106
Members
406,412
Latest member
superjoejoe

This Week's Hot Topics

Top