Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default conditional formatting

Hi,

I'm building a database and need to apply 4 levels of conditional formatting
so each row will change color. The conditions and colors are...

Completed = Green
Awaiting docs = Orange
Credit issue = Red
Declined = Grey

It's range is columns A:Q and the column this data is stored in is "O".

I've tried several variations, but can't get it to work. Any suggestions
would be greatly appreciated.

regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default conditional formatting

Unless you are using XL2007, you can't have 4 different Conditional Formats;
you will need to use this VB event code...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim R As Range
For Each R In Target
If R.Column = 15 Then
Select Case R.Value
Case "Completed"
Range("A" & R.Row & ":Q" & R.Row).Interior.ColorIndex = 35
Case "Awaiting docs"
Range("A" & R.Row & ":Q" & R.Row).Interior.ColorIndex = 45
Case "Credit issue"
Range("A" & R.Row & ":Q" & R.Row).Interior.ColorIndex = 38
Case "Declined"
Range("A" & R.Row & ":Q" & R.Row).Interior.ColorIndex = 15
End Select
End If
Next
End Sub

To implement this event code, right click the name tab for the worksheet
with your data on it, select View Code from the popup menu that appears, and
copy/paste the above code into the code window that appeared. Now go back to
your worksheet. Whenever you enter any of the four phrases you posted, the
row from A to Q will change to the color you asked for (well, a pale version
of the color so you can still see the text easily enough through it). If you
already have data in Column O, then select all of Column O, and then hit
Ctrl+C followed by Ctrl+V (keyboard shortcuts for copy/paste for Column O)
to force the Change event to act upon the existing entries.

--
Rick (MVP - Excel)


"Stringhaussen" wrote in message
...
Hi,

I'm building a database and need to apply 4 levels of conditional
formatting
so each row will change color. The conditions and colors are...

Completed = Green
Awaiting docs = Orange
Credit issue = Red
Declined = Grey

It's range is columns A:Q and the column this data is stored in is "O".

I've tried several variations, but can't get it to work. Any suggestions
would be greatly appreciated.

regards


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default conditional formatting

Thanks, it worked a treat!!

Regards

"Rick Rothstein" wrote:

Unless you are using XL2007, you can't have 4 different Conditional Formats;
you will need to use this VB event code...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim R As Range
For Each R In Target
If R.Column = 15 Then
Select Case R.Value
Case "Completed"
Range("A" & R.Row & ":Q" & R.Row).Interior.ColorIndex = 35
Case "Awaiting docs"
Range("A" & R.Row & ":Q" & R.Row).Interior.ColorIndex = 45
Case "Credit issue"
Range("A" & R.Row & ":Q" & R.Row).Interior.ColorIndex = 38
Case "Declined"
Range("A" & R.Row & ":Q" & R.Row).Interior.ColorIndex = 15
End Select
End If
Next
End Sub

To implement this event code, right click the name tab for the worksheet
with your data on it, select View Code from the popup menu that appears, and
copy/paste the above code into the code window that appeared. Now go back to
your worksheet. Whenever you enter any of the four phrases you posted, the
row from A to Q will change to the color you asked for (well, a pale version
of the color so you can still see the text easily enough through it). If you
already have data in Column O, then select all of Column O, and then hit
Ctrl+C followed by Ctrl+V (keyboard shortcuts for copy/paste for Column O)
to force the Change event to act upon the existing entries.

--
Rick (MVP - Excel)


"Stringhaussen" wrote in message
...
Hi,

I'm building a database and need to apply 4 levels of conditional
formatting
so each row will change color. The conditions and colors are...

Completed = Green
Awaiting docs = Orange
Credit issue = Red
Declined = Grey

It's range is columns A:Q and the column this data is stored in is "O".

I've tried several variations, but can't get it to work. Any suggestions
would be greatly appreciated.

regards



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default conditional formatting

Hi,

Right click your sheet tab, view code and paste this in and try entering
your values

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("O:O")) Is Nothing Then
Select Case UCase(Target.Value)
Case Is = "COMPLETED"
icolor = 4
Case Is = "AWAITING DOCS"
icolor = 45
Case Is = "CREDIT ISSUE"
icolor = 3
Case Is = "DECLINED"
icolor = 15
Case Else
icolor = xlNone
End Select
Range("A" & Target.Row & ":" & "Q" & Target.Row).Interior.ColorIndex = icolor
End If
End Sub

Mike

"Stringhaussen" wrote:

Hi,

I'm building a database and need to apply 4 levels of conditional formatting
so each row will change color. The conditions and colors are...

Completed = Green
Awaiting docs = Orange
Credit issue = Red
Declined = Grey

It's range is columns A:Q and the column this data is stored in is "O".

I've tried several variations, but can't get it to work. Any suggestions
would be greatly appreciated.

regards

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default conditional formatting

Thanks for you help,

Regards

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in and try entering
your values

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("O:O")) Is Nothing Then
Select Case UCase(Target.Value)
Case Is = "COMPLETED"
icolor = 4
Case Is = "AWAITING DOCS"
icolor = 45
Case Is = "CREDIT ISSUE"
icolor = 3
Case Is = "DECLINED"
icolor = 15
Case Else
icolor = xlNone
End Select
Range("A" & Target.Row & ":" & "Q" & Target.Row).Interior.ColorIndex = icolor
End If
End Sub

Mike

"Stringhaussen" wrote:

Hi,

I'm building a database and need to apply 4 levels of conditional formatting
so each row will change color. The conditions and colors are...

Completed = Green
Awaiting docs = Orange
Credit issue = Red
Declined = Grey

It's range is columns A:Q and the column this data is stored in is "O".

I've tried several variations, but can't get it to work. Any suggestions
would be greatly appreciated.

regards



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--different formatting depending on cell con Tammy S. Excel Discussion (Misc queries) 3 March 30th 09 08:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
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 that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


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