LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Need help to changes a conditional formatting code....

How do I change this code to first apply the "If" to data in the cell across
in Column E of the current row (eg RC5), if it's true and the value in the
current cell is greater than 0 then apply the formatting?
Thanks in Advance
BeSmart

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Value = "Cat" Then
Target.Cells.Interior.ColorIndex = 1
ElseIf Target.Value = "Dog" Then
Target.Cells.Interior.ColorIndex = 4
ElseIf Target.Value = "Horse" Then
Target.Cells.Interior.ColorIndex = 5
ElseIf Target.Value = "Camel" Then
Target.Cells.Interior.ColorIndex = 6
ElseIf Target.Value = "Pig" Then
Target.Cells.Interior.ColorIndex = 7
Else
Target.Cells.Interior.ColorIndex = xlnone
End If

End Sub

 
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
Conditional Formatting using code Ayo Excel Discussion (Misc queries) 5 February 29th 08 01:09 PM
Override conditional formatting with code Sarah Excel Discussion (Misc queries) 4 April 30th 07 08:28 PM
Evaluate conditional formatting in code Marq Excel Programming 2 August 10th 04 10:05 AM
Conditional Formatting using VBA Code andibevan Excel Programming 2 July 9th 04 04:43 PM
conditional formatting vba code and calculation Jill[_7_] Excel Programming 1 May 25th 04 12:31 AM


All times are GMT +1. The time now is 06:16 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"