close

It only let's me set 6 conditons but I have a spreadsheet with over 10
conditions that I want to show so using conditional formatting at all becomes
a problem if I can't highlight all 10 conditions anyway. Is there any way to
add more than the default of 6 as a maximum?

You have 6 conditions. That is 3 more than anyone else lt;vbggt;.

You could try event code, such asPrivate Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = quot;H1:H10quot;

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 6 'yellow
Case 3: .Interior.ColorIndex = 5 'blue
Case 4: .Interior.ColorIndex = 10 'green
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.or try the free add-in at
www.xldynamic.com/source/xld.....Download.html

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;Magdaquot; gt; wrote in message
...
gt; It only let's me set 6 conditons but I have a spreadsheet with over 10
gt; conditions that I want to show so using conditional formatting at all
becomes
gt; a problem if I can't highlight all 10 conditions anyway. Is there any way
to
gt; add more than the default of 6 as a maximum?
Thanks Bob.

The 6 was a typo by me! Sorry, I did mean 3! Obviously, that's the maximum
allowed....

I will try the event code you referred to. Thanks for you input.

Magda

quot;Bob Phillipsquot; wrote:

gt; You have 6 conditions. That is 3 more than anyone else lt;vbggt;.
gt;
gt; You could try event code, such as
gt;
gt;
gt; Private Sub Worksheet_Change(ByVal Target As Range)
gt; Const WS_RANGE As String = quot;H1:H10quot;
gt;
gt; On Error GoTo ws_exit:
gt; Application.EnableEvents = False
gt; If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
gt; With Target
gt; Select Case .Value
gt; Case 1: .Interior.ColorIndex = 3 'red
gt; Case 2: .Interior.ColorIndex = 6 'yellow
gt; Case 3: .Interior.ColorIndex = 5 'blue
gt; Case 4: .Interior.ColorIndex = 10 'green
gt; End Select
gt; End With
gt; End If
gt;
gt; ws_exit:
gt; Application.EnableEvents = True
gt; End Sub
gt;
gt; 'This is worksheet event code, which means that it needs to be
gt; 'placed in the appropriate worksheet code module, not a standard
gt; 'code module. To do this, right-click on the sheet tab, select
gt; 'the View Code option from the menu, and paste the code in.
gt;
gt;
gt; or try the free add-in at
gt; www.xldynamic.com/source/xld.....Download.html
gt;
gt; --
gt; HTH
gt;
gt; Bob Phillips
gt;
gt; (remove nothere from email address if mailing direct)
gt;
gt; quot;Magdaquot; gt; wrote in message
gt; ...
gt; gt; It only let's me set 6 conditons but I have a spreadsheet with over 10
gt; gt; conditions that I want to show so using conditional formatting at all
gt; becomes
gt; gt; a problem if I can't highlight all 10 conditions anyway. Is there any way
gt; to
gt; gt; add more than the default of 6 as a maximum?
gt;
gt;
gt;

I know, I was only kidding

Bob

quot;Magdaquot; gt; wrote in message
...
gt; Thanks Bob.
gt;
gt; The 6 was a typo by me! Sorry, I did mean 3! Obviously, that's the maximum
gt; allowed....
gt;
gt; I will try the event code you referred to. Thanks for you input.
gt;
gt; Magda
gt;
gt; quot;Bob Phillipsquot; wrote:
gt;
gt; gt; You have 6 conditions. That is 3 more than anyone else lt;vbggt;.
gt; gt;
gt; gt; You could try event code, such as
gt; gt;
gt; gt;
gt; gt; Private Sub Worksheet_Change(ByVal Target As Range)
gt; gt; Const WS_RANGE As String = quot;H1:H10quot;
gt; gt;
gt; gt; On Error GoTo ws_exit:
gt; gt; Application.EnableEvents = False
gt; gt; If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
gt; gt; With Target
gt; gt; Select Case .Value
gt; gt; Case 1: .Interior.ColorIndex = 3 'red
gt; gt; Case 2: .Interior.ColorIndex = 6 'yellow
gt; gt; Case 3: .Interior.ColorIndex = 5 'blue
gt; gt; Case 4: .Interior.ColorIndex = 10 'green
gt; gt; End Select
gt; gt; End With
gt; gt; End If
gt; gt;
gt; gt; ws_exit:
gt; gt; Application.EnableEvents = True
gt; gt; End Sub
gt; gt;
gt; gt; 'This is worksheet event code, which means that it needs to be
gt; gt; 'placed in the appropriate worksheet code module, not a standard
gt; gt; 'code module. To do this, right-click on the sheet tab, select
gt; gt; 'the View Code option from the menu, and paste the code in.
gt; gt;
gt; gt;
gt; gt; or try the free add-in at
gt; gt; www.xldynamic.com/source/xld.....Download.html
gt; gt;
gt; gt; --
gt; gt; HTH
gt; gt;
gt; gt; Bob Phillips
gt; gt;
gt; gt; (remove nothere from email address if mailing direct)
gt; gt;
gt; gt; quot;Magdaquot; gt; wrote in message
gt; gt; ...
gt; gt; gt; It only let's me set 6 conditons but I have a spreadsheet with over 10
gt; gt; gt; conditions that I want to show so using conditional formatting at all
gt; gt; becomes
gt; gt; gt; a problem if I can't highlight all 10 conditions anyway. Is there any
way
gt; gt; to
gt; gt; gt; add more than the default of 6 as a maximum?
gt; gt;
gt; gt;
gt; gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()