Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Worksheet_change Target Address is Reference Cell | Excel Programming | |||
MS Bug? Data validation list dropdown with Worksheet_Change event | Excel Programming | |||
Worksheet_Change and comment in a cell | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming | |||
worksheet_change vs. calculate, and worksheet_change not running | Excel Programming |