Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() '----------------------------------------------------------------- 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 "cds": .Interior.ColorIndex = 5 'blue Case "vgh": .Interior.ColorIndex = 5 'blue Case "cda": .Interior.ColorIndex = 46 'orange Case "khg": .Interior.ColorIndex = 46 'orange Case "bn": .Interior.ColorIndex = 3 'red 'etc. End Select End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "kate" wrote in message ... Could you please help me? I am trying to format text to highlight different colours depending on code e.g cds (I would like to be blue) and vgh ( I would like to be blue) bn (I would like to be red) cda ( I would like to be orange) and khg (I would like to be orange) and so on... The data range is c1:c550 with various names hope you can help thankyou Kate |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Formatting when inserting a row | Excel Worksheet Functions | |||
Conditional formatting : amount of decimals | Excel Discussion (Misc queries) | |||
Formulas dealing with text data | Excel Worksheet Functions | |||
How do I apply conditional formatting to a text box | Excel Worksheet Functions | |||
Conditional Formatting based on Text within Text | Excel Discussion (Misc queries) |