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

Hi, my worksheet contains six columns, column A has a description, and
column B - F has a validation wherein users enter an "X". My problem
is:
1. Does anyone know of a script that highlights the entire row with a
certain color if an X is entered on Column B - F (different colors for
each column, and I have the color codes already).
2. Prevents users from entering two "X"s on the same row
3. Allows users to delete an "X" from a column, and clears the row of
any colors.
Hopefully someone can help me, because I've searched high and low for
this, to no avail. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default More than three conditional formatting

On Mar 31, 6:46*pm, wrote:
Hi, my worksheet contains six columns, column A has a description, and
column B - F has a validation wherein users enter an "X". My problem
is:
1. Does anyone know of a script that highlights the entire row with a
certain color if an X is entered on Column B - F (different colors for
each column, and I have the color codes already).
2. Prevents users from entering two "X"s on the same row
3. Allows users to delete an "X" from a column, and clears the row of
any colors.
Hopefully someone can help me, because I've searched high and low for
this, to no avail. Thanks!


Your best bet would be a macro, triggered either manually or via a
change event.
I'm sure there are much more efficient ways, but a start would be
along the lines of:
(note: untested)

Sub colortest()
For x = 2 To Range("A65536").End(xlUp).Row
numberofx = 0 'simple counter to confirm each row only has one X
For y = 2 To 6
If UCase(Cells(x, y).Value) = "X" Then
numberofx = numberofx + 1
Select Case y
Case 1: Cells(x, y).EntireRow.Interior.ColorIndex = 6
Case 2: Cells(x, y).EntireRow.Interior.ColorIndex = 7
'etc for each color
End Select
End If
Next
If numberofx = 0 Or numberofx 1 Then Cells(x,
2).EntireRow.Interior.ColorIndex = xlNone
Next
End Sub



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 03:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"