Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jan Jan is offline
external usenet poster
 
Posts: 159
Default clearcontents, worksheet_change, cell validation

In a 2000 template I have a cell that has a data validation list. When the
value of this cell is changed, 2 other cells have to be cleared. This is
done by programming the worksheet_change event with a cell().clearcontents.
This is the problem: when you type a value from the list, the event fires
and the clearcontents does its work, however if you select a value from the
list the event also fires but the clearcontents doesn't work and doesn't give
an error
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default clearcontents, worksheet_change, cell validation

If the event fires and the code to clear the cells is in that event, then
the normal behavior is for the cells to be cleared in all cases. I don't
see any obvious reason why you would experience this behavior. If that is
the case, however, I think it involves the condititions in your particular
worksheet. I would copy the event code to a new workbook with no other code
and see if you can reproduce the problem. If not, then start introducing
other elements of your workbook and see if you can identify when the
behavior starts.

--
Regards,
Tom Ogilvy

"Jan" wrote in message
...
In a 2000 template I have a cell that has a data validation list. When the
value of this cell is changed, 2 other cells have to be cleared. This is
done by programming the worksheet_change event with a

cell().clearcontents.
This is the problem: when you type a value from the list, the event fires
and the clearcontents does its work, however if you select a value from

the
list the event also fires but the clearcontents doesn't work and doesn't

give
an error



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default clearcontents, worksheet_change, cell validation

Jan,
A while back I had a similar problem and I think I solved it by inserting in
my code:
Range("A1").Select to get the focus away from the validation cell.

"Jan" wrote:

In a 2000 template I have a cell that has a data validation list. When the
value of this cell is changed, 2 other cells have to be cleared. This is
done by programming the worksheet_change event with a cell().clearcontents.
This is the problem: when you type a value from the list, the event fires
and the clearcontents does its work, however if you select a value from the
list the event also fires but the clearcontents doesn't work and doesn't give
an error

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
Worksheet_change Target Address is Reference Cell mpreddy[_2_] Excel Programming 0 September 29th 04 07:51 AM
MS Bug? Data validation list dropdown with Worksheet_Change event Dan Frederick Excel Programming 0 April 6th 04 05:35 AM
Worksheet_Change and comment in a cell GJ Excel Programming 1 December 12th 03 03:50 AM
worksheet_change vs. calculate, and worksheet_change not running Tom Ogilvy Excel Programming 1 July 14th 03 02:51 AM
worksheet_change vs. calculate, and worksheet_change not running Ross[_5_] Excel Programming 0 July 13th 03 04:27 PM


All times are GMT +1. The time now is 07:26 AM.

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"