LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Conditional Formatting & Vlookup

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup and Conditional Formatting exceluser Excel Worksheet Functions 1 December 31st 07 03:35 PM
VLookup & Conditional Formatting together Mike Excel Worksheet Functions 4 December 19th 07 12:00 PM
vlookup with conditional formatting pm Excel Worksheet Functions 1 January 4th 07 05:32 PM
VLookup for Conditional Formatting Alicia Excel Discussion (Misc queries) 2 December 7th 06 12:49 AM
vlookup & conditional formatting Emma Excel Worksheet Functions 5 February 23rd 05 02:29 PM


All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"