Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use code like the short example below as worksheet event code to
change cell and font color in various work sheets. It works perfect with numeric cell values but now I need to modify it to work with "cel.value = A" (there will be A thru F) instead of 1. This will apply to a different range of cells than the numeric, as maybe B1:B10. I assume the term "IsNumeric(cel.Value)" needs to be changed, but I can't figure out what it should be. Using Office 2000 Can anyone please help? Private Sub Worksheet_SelectionChange(ByVal Target As Range) For Each cel In Range("A1:A10").Cells If IsNumeric(cel.Value) And cel.Value < "" Then If cel.Value = 1 Then cel.Font.ColorIndex = 1 cel.Interior.ColorIndex = 4 ElseIf cel.Value = 2 Then cel.Font.ColorIndex = 1 cel.Interior.ColorIndex = 45 End If Else cel.Font.ColorIndex = 1 cel.Interior.ColorIndex = 0 End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy cell and the font color | Excel Discussion (Misc queries) | |||
Conditional Format for font color using font color | Excel Worksheet Functions | |||
Cannot change font color or cell color | Excel Discussion (Misc queries) | |||
How to change the default Border, Font Color, and Cell Color | Excel Discussion (Misc queries) | |||
Default Border, Font Color, and Cell Background Color | Excel Discussion (Misc queries) |