Hi,
I tried using conditional formating to have cell font color and background color change and while it works in Excel 2003 and 2007, it is not working for an Excel 2010 user. So I thought I would use VBA so it will work in any of the three versions but the code below is not working.
Based on the values calculated in two cells I want Excel to possibbly change the color of the font and background color of cells D8:D9. The ranges "none_of_above" and "sum_for_cond_check" are on a different sheet than the one I want to change the cell colors.
The code below is located on the object for the Segment Classification Sheet.
Private Sub Worksheet_Change(ByVal Target As Range)
Sheets("Segment Classification").Activate
Range("D8:D9").Select
If (Range("none_of_above") = 1 And Range("sum_for_cond_check") > 0) Then
Selection.Interior.ColorIndex = 3
Selection.Font.ColorIndex = 1
Else
End If
End Sub
Thank you in advance for your assistance.
I tried using conditional formating to have cell font color and background color change and while it works in Excel 2003 and 2007, it is not working for an Excel 2010 user. So I thought I would use VBA so it will work in any of the three versions but the code below is not working.
Based on the values calculated in two cells I want Excel to possibbly change the color of the font and background color of cells D8:D9. The ranges "none_of_above" and "sum_for_cond_check" are on a different sheet than the one I want to change the cell colors.
The code below is located on the object for the Segment Classification Sheet.
Private Sub Worksheet_Change(ByVal Target As Range)
Sheets("Segment Classification").Activate
Range("D8:D9").Select
If (Range("none_of_above") = 1 And Range("sum_for_cond_check") > 0) Then
Selection.Interior.ColorIndex = 3
Selection.Font.ColorIndex = 1
Else
End If
End Sub
Thank you in advance for your assistance.