Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 407
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 407
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation Work Around Neil M Excel Discussion (Misc queries) 3 April 26th 08 03:55 AM
Custom data validation doesn't work well clara Excel Worksheet Functions 1 June 18th 07 03:16 PM
Data validation don't work Mary Excel Discussion (Misc queries) 7 March 16th 07 08:32 PM
Why does data validation not work when pasting data into a cell. rjshelby Excel Discussion (Misc queries) 1 July 31st 06 09:08 PM
Data Validation doesn't work on 1 sheet only lunker55 Excel Discussion (Misc queries) 4 February 25th 05 05:25 PM


All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"