erutherford
Active Member
- Joined
- Dec 19, 2016
- Messages
- 453
I currently have the following code in "worksheet"/SelectionChange and it works fine. I am sure there is a simpler to way to write the code, but right now it easier to find code and modify it.
In column I there is code
Target.value doesn't like reading that code. If I delete the code and just enter the letter it works fine. I need it to run off the formula.
Thanks in advance
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("I:I")) Is Nothing Then Exit Sub 'check for range
If Target.Value = "W" Then 'check if "W"
Target.Offset(0, 6).Interior.ColorIndex = 1 ' "1"=Black
Target.Offset(0, 7).Interior.ColorIndex = 1
Target.Offset(0, 6).Font.ColorIndex = 3 ' "3"=Red
Target.Offset(0, 7).Font.ColorIndex = 3 ' "3"=Red
ElseIf Target.Value = "S" Then 'check if "S"
Target.Offset(0, 6).Interior.ColorIndex = 1 ' "1"=Black
Target.Offset(0, 7).Interior.ColorIndex = 1
Target.Offset(0, 6).Font.ColorIndex = 3 ' "3"=Red
Target.Offset(0, 7).Font.ColorIndex = 3 ' "3"=Red
Else
Target.Offset(0, 6).Interior.ColorIndex = 27
Target.Offset(0, 7).Interior.ColorIndex = 27
Target.Offset(0, 6).Font.ColorIndex = 1
Target.Offset(0, 7).Font.ColorIndex = 1
End If
End Sub
In column I there is code
Code:
=Entries!I1
Target.value doesn't like reading that code. If I delete the code and just enter the letter it works fine. I need it to run off the formula.
Thanks in advance