thedeadzeds
New member
- Joined
- Oct 25, 2011
- Messages
- 37
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- 2016
Hi All,
I have this code that works great but works on the whole worksheet.
Can this code be adapted to to use only on columns, C, E, G and H?
Many thanks
Craig
I have this code that works great but works on the whole worksheet.
Can this code be adapted to to use only on columns, C, E, G and H?
Many thanks
Craig
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
Dim Rng1 As Range
On Error Resume Next
Set Rng1 = ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas, 1)
On Error GoTo 0
If Rng1 Is Nothing Then
Set Rng1 = Range(Target.Address)
Else
Set Rng1 = Union(Range(Target.Address), Rng1)
End If
For Each Cell In Rng1
Select Case Cell.Value
Case vbNullString
Cell.Interior.ColorIndex = xlNone
Cell.Font.Bold = False
Case 0.9 To 1
Cell.Interior.ColorIndex = 4
Cell.Font.Bold = True
Case 0.8 To 0.89999999999999
Cell.Interior.ColorIndex = 36
Cell.Font.Bold = True
Case 0.1 To 0.799999999999999
Cell.Interior.ColorIndex = 3
Cell.Font.Bold = True
Case 0
Cell.Interior.ColorIndex = 6
Cell.Font.Bold = True
Case Else
Cell.Interior.ColorIndex = xlNone
Cell.Font.Bold = False
End Select
Next
End Sub