Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to add different colours to different numbers in an excel sheet.
So for example "1234" should be green every time when these determined caracters (numbers) appears on the sheet. Can I do it? And if yes, can i match more determined caracters with different coulours. Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sheva,
You can easily accomplish this through CONDITIONAL FORMATTING. - Highlight the entire sheet (or column that will contain the number that you are searching for) - From the menu select FORMAT Conditional Format - From the box select CELL VALUE IS EQUAL TO - In the box beside that type in the value you are looking to highlight - Press the FORMAT button and select the color that you wish to apply to that number If you want to look for and change the color of other numbers, then click on ADD and repeat the above steps. HTH Tom "sheva" wrote: I would like to add different colours to different numbers in an excel sheet. So for example "1234" should be green every time when these determined caracters (numbers) appears on the sheet. Can I do it? And if yes, can i match more determined caracters with different coulours. Thanks! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
'----------------------------------------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) '----------------------------------------------------------------- Dim iPos As Long Const TEST_VALUE_1 As String = "1234" Const TEST_COLORINDEX_1 As Long = 10 Const TEST_VALUE_2 As String = "789" Const TEST_COLORINDEX_2 As Long = 5 On Error GoTo ws_exit: Application.EnableEvents = False With Target Select Case True Case InStr(CStr(.Value), TEST_VALUE_1) 0: .Characters(iPos, Len(TEST_VALUE_1)). _ Font.ColorIndex = TEST_COLORINDEX_1 Case InStr(CStr(.Value), TEST_VALUE_2) 0: .Characters(iPos, Len(TEST_VALUE_2)). _ Font.ColorIndex = TEST_COLORINDEX_2 'etc. End Select End With 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 (remove xxx from email address if mailing direct) "sheva" wrote in message ... I would like to add different colours to different numbers in an excel sheet. So for example "1234" should be green every time when these determined caracters (numbers) appears on the sheet. Can I do it? And if yes, can i match more determined caracters with different coulours. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to extract caracters up to comma in excel cell | Excel Worksheet Functions | |||
count the number of caracters in a cell | New Users to Excel | |||
count the number of caracters in a cell | New Users to Excel | |||
Increase Fotter Caracters | Excel Programming | |||
Can you Limit the number of caracters that can be typed in a cell? | Excel Programming |