![]() |
Select Case Statement - Help Font Color
Here is my code and when the variable icolor is equal to 53 which does set
the interior color I would like the font to turn white because it is hard to read in black. What is the correct syntax and will the If statement after the case statement do the trick? My code is off because my font will not turn white right now. If Not (Intersect(Target, Me.Range("BESTDel")) Is Nothing) Then Select Case Target.Value Case Is = "": icolor = xlNone Case Is < 0.9: icolor = 3 Case Is < 0.96: icolor = 6 Case Is < 0.98: icolor = 53 Case Is < 1: icolor = 16 Case Is = 1: icolor = 44 Case Else: icolor = xlNone End Select If icolor = 53 Then Target.Cells.Font.Color = 0 End If Target.Interior.ColorIndex = icolor |
Select Case Statement - Help Font Color
Hi,
Try something like this Target.Font.ColorIndex = 2 -- Thanks, Shane Devenshire "Walter" wrote: Here is my code and when the variable icolor is equal to 53 which does set the interior color I would like the font to turn white because it is hard to read in black. What is the correct syntax and will the If statement after the case statement do the trick? My code is off because my font will not turn white right now. If Not (Intersect(Target, Me.Range("BESTDel")) Is Nothing) Then Select Case Target.Value Case Is = "": icolor = xlNone Case Is < 0.9: icolor = 3 Case Is < 0.96: icolor = 6 Case Is < 0.98: icolor = 53 Case Is < 1: icolor = 16 Case Is = 1: icolor = 44 Case Else: icolor = xlNone End Select If icolor = 53 Then Target.Cells.Font.Color = 0 End If Target.Interior.ColorIndex = icolor |
All times are GMT +1. The time now is 07:27 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com