Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 78
Default Conditional Formatting

I need to format 5 conditions in a particular spreadsheet. I can add the 4th
by using the fill option over the area but having problems adding the 5th.
Any ideas? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Conditional Formatting

Melanie,

You can have an unlimited amount with the worksheet_change event and select
case.

Right click your sheet tab|view code and paste this in:-

Private Sub Worksheet_Change(ByVal Target As Range)
Dim colour As Integer

If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
Select Case Target
Case 1
colour = 6
Case 2
colour = 12
Case 3
colour = 7
Case 4
colour = 53
Case 5
colour = 15
Case 6
colour = 42
Case Else
'do nothing
End Select

Target.Interior.ColorIndex = colour
End If

End Sub

Alter what thecase is to suit for example
Case Is = "some text"

or

Case Is 99

Mike




"Melanie" wrote:

I need to format 5 conditions in a particular spreadsheet. I can add the 4th
by using the fill option over the area but having problems adding the 5th.
Any ideas? Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 78
Default Conditional Formatting

Thanks Mike, a great help.

Melanie

"Mike H" wrote:

Melanie,

You can have an unlimited amount with the worksheet_change event and select
case.

Right click your sheet tab|view code and paste this in:-

Private Sub Worksheet_Change(ByVal Target As Range)
Dim colour As Integer

If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
Select Case Target
Case 1
colour = 6
Case 2
colour = 12
Case 3
colour = 7
Case 4
colour = 53
Case 5
colour = 15
Case 6
colour = 42
Case Else
'do nothing
End Select

Target.Interior.ColorIndex = colour
End If

End Sub

Alter what thecase is to suit for example
Case Is = "some text"

or

Case Is 99

Mike




"Melanie" wrote:

I need to format 5 conditions in a particular spreadsheet. I can add the 4th
by using the fill option over the area but having problems adding the 5th.
Any ideas? Thanks.

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 based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 0 January 15th 07 04:35 PM
Conditional Formatting MDewitz Excel Discussion (Misc queries) 2 September 13th 06 05:28 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM
Conditional formatting ChristinaC Excel Discussion (Misc queries) 4 February 18th 05 11:53 PM


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