Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default EXCEL 2003 - Conditional Formatting

I have a table and in one column the user needs to add a number between 1-7
(inclusive) to show the status. Ideally I would then like the whole row to
be coloured, depending on the number inserted (eg. 1=Blue, 2=red, etc)

With the conditional formatting option within Excel I can only do 3 options.

How do I overcome this?


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default EXCEL 2003 - Conditional Formatting

This can, easily, be accomplished in Excel 2007 OR with a Macro.
Use Select Case segment in order to check the value [1-7] and accordingly
color the row.
Micky


"Peterepeat" wrote:

I have a table and in one column the user needs to add a number between 1-7
(inclusive) to show the status. Ideally I would then like the whole row to
be coloured, depending on the number inserted (eg. 1=Blue, 2=red, etc)

With the conditional formatting option within Excel I can only do 3 options.

How do I overcome this?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default EXCEL 2003 - Conditional Formatting

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("A1:A100") 'adjust to suit
If Intersect(Target, r) Is Nothing Then
Exit Sub
End If
vals = Array(1, 2, 3, 4, 5, 6, 7) 'cell values
nums = Array(8, 9, 6, 3, 7, 4, 20) 'colorindex numbers
For Each rr In r
icolor = 0
For i = LBound(vals) To UBound(vals)
If rr.Value = vals(i) Then
icolor = nums(i)
End If
Next
If icolor 0 Then
rr.EntireRow.Interior.ColorIndex = icolor
End If
Next
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the code into that module.

Edit to suit. Alt + q to return to Excel.


Gord Dibben MS Excel MVP

On Thu, 14 Jan 2010 00:16:01 -0800, Peterepeat
wrote:

I have a table and in one column the user needs to add a number between 1-7
(inclusive) to show the status. Ideally I would then like the whole row to
be coloured, depending on the number inserted (eg. 1=Blue, 2=red, etc)

With the conditional formatting option within Excel I can only do 3 options.

How do I overcome this?


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 formatting in excel 2003 GrouchyMammy Excel Worksheet Functions 5 April 13th 09 04:05 AM
conditional formatting in excel 2003 Quandary 11 - 3 - 07[_2_] Excel Discussion (Misc queries) 5 March 30th 09 05:11 AM
Conditional Formatting - Excel 2003 Dan Excel Discussion (Misc queries) 3 September 9th 08 05:43 PM
Conditional formatting excel 2003 DonMRay@gmail.com Excel Worksheet Functions 1 April 14th 08 12:43 PM
Excel 2003: Conditional Formatting oceanmist Excel Discussion (Misc queries) 3 September 20th 06 11:55 PM


All times are GMT +1. The time now is 10:57 AM.

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"