Change Font Color

memartin

New Member
Joined
Oct 28, 2010
Messages
6
I want to change the font color from the default (black) to red for part of a result within a cell.
For example, the formula ="The current version date is: "&right(Tab1!$A$13,9) produces "The current version date is: 6/20/12" all in black.
But I want it to produce "The current version date is: 6/20/12". Any suggestions?
 

Some videos you may like

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

rob.barnes01

Board Regular
Joined
Aug 26, 2010
Messages
94
If it's practical for your application, you could place the string "The current version date is: " in one cell and place the formula in the cell directly adjacent to it, formatted in red.
 

mathchick

Active Member
Joined
Mar 21, 2012
Messages
337
only option would be to have "The current version date is: " and "6/20/12" in different cells
 

memartin

New Member
Joined
Oct 28, 2010
Messages
6
If it's practical for your application, you could place the string "The current version date is: " in one cell and place the formula in the cell directly adjacent to it, formatted in red.

thank you for the suggestion. I will do that.
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,711
Office Version
  1. 2010
Platform
  1. Windows
only option would be to have "The current version date is: " and "6/20/12" in different cells

Another option would be to remove the formula and fill the cell from VB event code...

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Const OutputSheet As String = "Sheet2"
  Const OutputCell As String = "B2"
  If Target.Address(0, 0) = "A13" Then
    With Worksheets(OutputSheet).Range(OutputCell)
      .Value = "The current version date is: " & Right(Target.Value, 9)
      .Characters(30, 9).Font.ColorIndex = 3
    End With
  End If
End Sub

HOW TO INSTALL Event Code
------------------------------------
If you are new to event code procedures, they are easy to install. To install it, right-click the name tab at the bottom of the worksheet that is to have the functionality to be provided by the event code and select "View Code" from the popup menu that appears. This will open up the code window for that worksheet. Copy/Paste the event code into that code window. That's it... the code will now operate automatically when its particular event procedure is raised by an action you take on the worksheet itself.
 

memartin

New Member
Joined
Oct 28, 2010
Messages
6
Another option would be to remove the formula and fill the cell from VB event code...

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Const OutputSheet As String = "Sheet2"
  Const OutputCell As String = "B2"
  If Target.Address(0, 0) = "A13" Then
    With Worksheets(OutputSheet).Range(OutputCell)
      .Value = "The current version date is: " & Right(Target.Value, 9)
      .Characters(30, 9).Font.ColorIndex = 3
    End With
  End If
End Sub

HOW TO INSTALL Event Code
------------------------------------
If you are new to event code procedures, they are easy to install. To install it, right-click the name tab at the bottom of the worksheet that is to have the functionality to be provided by the event code and select "View Code" from the popup menu that appears. This will open up the code window for that worksheet. Copy/Paste the event code into that code window. That's it... the code will now operate automatically when its particular event procedure is raised by an action you take on the worksheet itself.

This a great solution. I will try it. Thank you very much.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,158
Messages
5,600,054
Members
414,357
Latest member
Gemma_R

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
Top