clearcontents, worksheet_change, cell validation

G

Guest

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
 
T

Tom Ogilvy

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top