?Conditional protection

  • Thread starter Thread starter yorkeyite
  • Start date Start date
Y

yorkeyite

If I use the following formula to count the Es in a rang
=COUNTIF(E15:E26,"E") I can use conditional formatting to advise peopl
making entries into that range if there not enough or too many.

is it possible to write some vb code that defaults the value of th
active cell to 0 if value of the countif function is >3

This will place the active cell outside the list paramenters of th
conditional formatting and trigger an error message which is what I a
afte
 
-----Original Message-----
If I use the following formula to count the Es in a range
=COUNTIF(E15:E26,"E") I can use conditional formatting to advise people
making entries into that range if there not enough or too many.

is it possible to write some vb code that defaults the value of the
active cell to 0 if value of the countif function is >3

This will place the active cell outside the list paramenters of the
conditional formatting and trigger an error message which is what I am
after


---
Message posted

.
It is possible, it depends how you want to run it, it can
be done in vb code, but why not do


=if(COUNTIF(E15:E26,"E")>3,0,COUNTIF(E15:E26,"E"))
 
Wrong cell

I need the active cell ie the last cell in the countif range to have
typed into it to default to 0 when the value of the countif functio
exceedes
 
You mean that the huser is typing into this cell, but if they type an 'E' and
there are already 3 E's in the list, the user's entry should be changed to 0?

You can't do that with a formula. You would need to employ a worksheet_change
event. To help with that, we need mopre information about where the CountIf
range is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top