Y
Yogin
Hi,
I am currently using the code below for conditional formating cells and it
works well, the problem I am having is that this code doesn't work when I use
it in worksheet where the cell values are from Vlookup.
Is there a way to do this?
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("G7:GT700")) Is Nothing Then
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
ErrHandler:
Application.EnableEvents = True
With Target
Select Case .Value
'Days
Case "DHOL"
..Cells.Interior.ColorIndex = 7
Case "DHOL4"
..Cells.Interior.ColorIndex = 7
Case "DS"
..Cells.Interior.ColorIndex = 8
Case "DRD"
..Cells.Interior.ColorIndex = 4
Case "DEX"
..Cells.Interior.ColorIndex = 3
Case Else
..Cells.Interior.ColorIndex = xlNone
End Select
End With
End If
End Sub
Thanks
Yogin
I am currently using the code below for conditional formating cells and it
works well, the problem I am having is that this code doesn't work when I use
it in worksheet where the cell values are from Vlookup.
Is there a way to do this?
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("G7:GT700")) Is Nothing Then
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
ErrHandler:
Application.EnableEvents = True
With Target
Select Case .Value
'Days
Case "DHOL"
..Cells.Interior.ColorIndex = 7
Case "DHOL4"
..Cells.Interior.ColorIndex = 7
Case "DS"
..Cells.Interior.ColorIndex = 8
Case "DRD"
..Cells.Interior.ColorIndex = 4
Case "DEX"
..Cells.Interior.ColorIndex = 3
Case Else
..Cells.Interior.ColorIndex = xlNone
End Select
End With
End If
End Sub
Thanks
Yogin