+ Reply to Thread
Results 1 to 3 of 3

clearcontents, worksheet_change, cell validation

  1. #1
    Jan
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    gocush
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1