Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting code - Changing the Text colour

Status
Not open for further replies.

Airbiskit

Technical User
May 20, 2003
89
GB
Hi,

I have used code from a previous Conditional Formatting question which works great, I have changed it to match my needs...nothing amazing I must add. But I am looking to change the text colour to match the interior colour property, so the hole cell is the same colour.

Code is below with my attempt at changing the text colour please correct the line accordingly.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim oCell As Range
For Each oCell In Target
Select Case oCell.Value
Case Is = "TM", "tm"
oCell.Interior.Color = RGB(255, 100, 0)
*********oCell.Value.Color = RGB(255, 100, 0)******
Case Is = "SS", "ss"
oCell.Interior.Color = RGB(255, 255, 0)
Case Is = "R", "r"
oCell.Interior.Color = RGB(255, 100, 150)
Case Is = "TR", "tr"
oCell.Interior.Color = RGB(100, 255, 200)
Case Else
oCell.Interior.ColorIndex = xlNone
End Select
Next oCell

End Sub

Many Thanks

Steve
 
Woohoo, no worries I worked it out.

Change Value to Font...

oCell.Font.Color = RGB(255, 100, 0)

Thats worked

Thanks

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top