Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do I get 1-5 entered as a value to format with each five numbers having
its own background color? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() "Cindy" wrote: How do I get 1-5 entered as a value to format with each five numbers having its own background color? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you have excel 2007 you can use conditional formatting, earlier versions
would need VBA http://www.xldynamic.com/source/xld.....Download.html -- Regards, Peo Sjoblom "Cindy" wrote in message ... "Cindy" wrote: How do I get 1-5 entered as a value to format with each five numbers having its own background color? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you; this worked great!
"Peo Sjoblom" wrote: If you have excel 2007 you can use conditional formatting, earlier versions would need VBA http://www.xldynamic.com/source/xld.....Download.html -- Regards, Peo Sjoblom "Cindy" wrote in message ... "Cindy" wrote: How do I get 1-5 entered as a value to format with each five numbers having its own background color? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You want this for one cell with a choice of 5 numbers?
Private Sub Worksheet_Change(ByVal Target As Range) Dim Num As Long Dim rng As Range Dim vRngInput As Variant Set vRngInput = Intersect(Target, Range("A1")) ' for a range use "A1:A10" or similar On Error GoTo endit Application.EnableEvents = False If vRngInput Is Nothing Then Exit Sub For Each rng In vRngInput 'Determine the color Select Case rng.Value Case Is = 1: Num = 6 'yellow Case Is = 2: Num = 10 'green Case Is = 3: Num = 5 'blue Case Is = 4: Num = 3 'red Case Is = 5: Num = 46 'orange End Select 'Apply the color rng.Interior.ColorIndex = Num Next rng endit: Application.EnableEvents = True End Sub This is sheet event code. Right-click on the sheet tab and "View Code". Copy/paste into that sheet module. Gord Dibben MS Excel MVP On Wed, 18 Jul 2007 07:46:12 -0700, Cindy wrote: How do I get 1-5 entered as a value to format with each five numbers having its own background color? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional format from a list of numbers | Excel Discussion (Misc queries) | |||
Conditional format numbers | Excel Worksheet Functions | |||
Conditional Format for Numbers | Excel Discussion (Misc queries) | |||
How do I do a conditional format for numbers | Excel Worksheet Functions |