Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How does data validation work
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How does data validation work
Thanks, Tom. Any chance you answer my solver problem? I could even e-mail
you the worksheet. "Tom Ogilvy" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data Validation Work Around | Excel Discussion (Misc queries) | |||
Custom data validation doesn't work well | Excel Worksheet Functions | |||
Data validation don't work | Excel Discussion (Misc queries) | |||
Why does data validation not work when pasting data into a cell. | Excel Discussion (Misc queries) | |||
Data Validation doesn't work on 1 sheet only | Excel Discussion (Misc queries) |