LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Conditonal formatting

Sorry Joel,

My VB isn't the greatest. How would i link my symbols to the case type?
Also would i have to run this macro everytime i finished updating something?

"Joel" wrote:

Thsi si a very popular question. It is asked a few times a week. Here is
the answer somebody provided earlier this week. It shows four conditions but
can easily be changes to havve many more conditions Just add more case
statements to the function.

-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "H1:H10" '<=== change to suit


On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 6 'yellow
Case 3: .Interior.ColorIndex = 5 'blue
Case 4: .Interior.ColorIndex = 10 'green
End Select
End With
End If


ws_exit:
Application.EnableEvents = True
End Sub



"Hawksby" wrote:

Is there a way of having 5 or more conditional formats?

 
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
Conditonal Formula flyers5182 Excel Discussion (Misc queries) 7 February 5th 07 09:17 PM
Self Tests, and Conditonal Formatting KiowaPilot Excel Discussion (Misc queries) 0 January 4th 07 06:49 PM
How do I do Conditonal Formatting with formula progression Steve Westwood Excel Worksheet Functions 4 August 24th 06 11:51 AM
Conditonal Formatting Matt Excel Discussion (Misc queries) 3 April 21st 06 07:42 PM
Protect conditonal formatting ITGuy Excel Discussion (Misc queries) 0 March 15th 05 10:47 AM


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