Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 130
Default Conditional format for 5 numbers

How do I get 1-5 entered as a value to format with each five numbers having
its own background color?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 130
Default Conditional format for 5 numbers in Excel 2003



"Cindy" wrote:

How do I get 1-5 entered as a value to format with each five numbers having
its own background color?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Conditional format for 5 numbers in Excel 2003

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 130
Default Conditional format for 5 numbers in Excel 2003

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Conditional format for 5 numbers

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
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 format from a list of numbers langba Excel Discussion (Misc queries) 3 April 7th 06 11:02 AM
Conditional format numbers PiPPo Excel Worksheet Functions 5 October 18th 05 05:03 AM
Conditional Format for Numbers Tyson Excel Discussion (Misc queries) 3 June 28th 05 02:08 AM
How do I do a conditional format for numbers bowada Excel Worksheet Functions 2 June 6th 05 05:10 PM


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