close

Hi I have three countif statements in my Excel spreadsheet that use
conditional formatting but I need to add a fourth but of couse Excel only
allows three. How can I get around this.

Thank you in advance
--
N/A

Use a default colour for all the cells, then just add 3 condition formats.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;Joelquot; gt; wrote in message
...
gt; Hi I have three countif statements in my Excel spreadsheet that use
gt; conditional formatting but I need to add a fourth but of couse Excel only
gt; allows three. How can I get around this.
gt;
gt; Thank you in advance
gt; --
gt; N/A
DEar Bob

Thank you what I am after is some code for VBA to turn a cell a certain
colour if a certain letter is typed. Conditional formatting is great but does
not help if you have more than thfree conditions.

For Example ig I type a H I want it to turn the cell green, Bh turn the cell
pink S turn yellow md L turn the cell Red

Thanks Joel
--
N/Aquot;Bob Phillipsquot; wrote:

gt; Use a default colour for all the cells, then just add 3 condition formats.
gt;
gt; --
gt; HTH
gt;
gt; Bob Phillips
gt;
gt; (remove nothere from email address if mailing direct)
gt;
gt; quot;Joelquot; gt; wrote in message
gt; ...
gt; gt; Hi I have three countif statements in my Excel spreadsheet that use
gt; gt; conditional formatting but I need to add a fourth but of couse Excel only
gt; gt; allows three. How can I get around this.
gt; gt;
gt; gt; Thank you in advance
gt; gt; --
gt; gt; N/A
gt;
gt;
gt;

I was suggesting that if you colour those cells all as yellow say, you only
need to test for the other three conditions, so CF works.

But if you must VBAPrivate 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 quot;Lquot;: .Interior.ColorIndex = 3 'red
Case quot;Squot;: .Interior.ColorIndex = 6 'yellow
Case quot;Bhquot;: .Interior.ColorIndex = 7 'pink
Case quot;Hquot;: .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.--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;Joelquot; gt; wrote in message
...
gt; DEar Bob
gt;
gt; Thank you what I am after is some code for VBA to turn a cell a certain
gt; colour if a certain letter is typed. Conditional formatting is great but
does
gt; not help if you have more than thfree conditions.
gt;
gt; For Example ig I type a H I want it to turn the cell green, Bh turn the
cell
gt; pink S turn yellow md L turn the cell Red
gt;
gt; Thanks Joel
gt; --
gt; N/A
gt;
gt;
gt; quot;Bob Phillipsquot; wrote:
gt;
gt; gt; Use a default colour for all the cells, then just add 3 condition
formats.
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;Joelquot; gt; wrote in message
gt; gt; ...
gt; gt; gt; Hi I have three countif statements in my Excel spreadsheet that use
gt; gt; gt; conditional formatting but I need to add a fourth but of couse Excel
only
gt; gt; gt; allows three. How can I get around this.
gt; gt; gt;
gt; gt; gt; Thank you in advance
gt; gt; gt; --
gt; gt; gt; N/A
gt; gt;
gt; gt;
gt; gt;
Thank you very much
--
N/Aquot;Bob Phillipsquot; wrote:

gt; I was suggesting that if you colour those cells all as yellow say, you only
gt; need to test for the other three conditions, so CF works.
gt;
gt; But if you must VBA
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 quot;Lquot;: .Interior.ColorIndex = 3 'red
gt; Case quot;Squot;: .Interior.ColorIndex = 6 'yellow
gt; Case quot;Bhquot;: .Interior.ColorIndex = 7 'pink
gt; Case quot;Hquot;: .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; --
gt; HTH
gt;
gt; Bob Phillips
gt;
gt; (remove nothere from email address if mailing direct)
gt;
gt; quot;Joelquot; gt; wrote in message
gt; ...
gt; gt; DEar Bob
gt; gt;
gt; gt; Thank you what I am after is some code for VBA to turn a cell a certain
gt; gt; colour if a certain letter is typed. Conditional formatting is great but
gt; does
gt; gt; not help if you have more than thfree conditions.
gt; gt;
gt; gt; For Example ig I type a H I want it to turn the cell green, Bh turn the
gt; cell
gt; gt; pink S turn yellow md L turn the cell Red
gt; gt;
gt; gt; Thanks Joel
gt; gt; --
gt; gt; N/A
gt; gt;
gt; gt;
gt; gt; quot;Bob Phillipsquot; wrote:
gt; gt;
gt; gt; gt; Use a default colour for all the cells, then just add 3 condition
gt; formats.
gt; gt; gt;
gt; gt; gt; --
gt; gt; gt; HTH
gt; gt; gt;
gt; gt; gt; Bob Phillips
gt; gt; gt;
gt; gt; gt; (remove nothere from email address if mailing direct)
gt; gt; gt;
gt; gt; gt; quot;Joelquot; gt; wrote in message
gt; gt; gt; ...
gt; gt; gt; gt; Hi I have three countif statements in my Excel spreadsheet that use
gt; gt; gt; gt; conditional formatting but I need to add a fourth but of couse Excel
gt; only
gt; gt; gt; gt; allows three. How can I get around this.
gt; gt; gt; gt;
gt; gt; gt; gt; Thank you in advance
gt; gt; gt; gt; --
gt; gt; gt; gt; N/A
gt; gt; gt;
gt; gt; gt;
gt; gt; gt;
gt;
gt;
gt;

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

    software

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