View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default How does data validation work

Yes.

--
Regards,
Tom Ogilvy



"Dean" wrote:

I had a cell which, using data, then validation, was set up to allow either
0 or 1 as input values. I also wrote a macro that would hide many rows if
you wanted a value of 0. Since I feared that some users would forget to set
it to 0 before hiding the rows (something that is critical), I had the macro
first query the user if he really wanted to choose 0 and hide the rows.
Then, if he chose yes, before hiding the rows, it would set that cell to
zero. The part of the macro that did this was:

Range("MinorityPartnerMode").Select
ActiveCell.Formula = 0

Later, I decided that choices of Yes or No would be better than 1 or 0. So,
I changed the list in data, then validation. And I changed the EXCEL code
to match. However, I forgot to edit the macro. To my surprise, the macro
did not crash, even though 0 is now not an allowed response. This leads me
to conclude that data validation only limits choices typed directly into a
cell and that changing the cell value via macro, somehow, circumvents the
limitation. Is this true (EXCEL 2003)?

Thanks!
Dean