PC Review


Reply
Thread Tools Rate Thread

How does data validation work

 
 
Dean
Guest
Posts: n/a
 
      28th Sep 2007
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 With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      28th Sep 2007
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 With Quote
 
Dean
Guest
Posts: n/a
 
      1st Oct 2007
Thanks, Tom. Any chance you answer my solver problem? I could even e-mail
you the worksheet.

"Tom Ogilvy" <(E-Mail Removed)> wrote in message
news:BB51E81F-6E52-4FD4-9FD9-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation Work Around Neil M Microsoft Excel Misc 3 26th Apr 2008 03:55 AM
Data validation don't work =?Utf-8?B?TWFyeQ==?= Microsoft Excel Misc 7 16th Mar 2007 08:32 PM
Why does data validation not work when pasting data into a cell. =?Utf-8?B?cmpzaGVsYnk=?= Microsoft Excel Misc 1 31st Jul 2006 09:08 PM
Data Validation Error Does Not Work? =?Utf-8?B?QWxleCBNYWNrZW56aWU=?= Microsoft Excel Worksheet Functions 3 6th Mar 2006 02:35 PM
Re: Data validation does not seem to work with copy/paste swatsp0p Microsoft Excel Misc 0 15th Sep 2005 09:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:56 PM.