+ Reply to Thread
Results 1 to 4 of 4

ComboBox Change event triggered incorrectly?

  1. #1
    Registered User
    Join Date
    03-20-2006
    Location
    SE England
    Posts
    20

    ComboBox Change event triggered incorrectly?

    Hi,

    I have a ComboBox with the Change event set up to modify a few things according to the value selected.

    On a separate sheet in the same workbook, I am changing the value of a cell, and for some reason this is executing the ComboBox Change code. The reason I know this is because I am getting a runtime error in the ComboBox Change code.

    Is this to be expected, and I just haven't noticed before because there was no runtime error?

    Thanks,
    Vindaloo

  2. #2
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    this is not default behaviour for a combo.

    What other change events have you got in your workbook?

  3. #3
    Registered User
    Join Date
    03-20-2006
    Location
    SE England
    Posts
    20
    The only other Change events that I have are for 2 checkboxes. I've now commented these out but the problem remains.

    I am in the process of trying to remove everything bit by bit until the problem disappears, then hopefully the last thing that I removed will be the cause. This is quite time-consuming, so any help in the meantime will be greatly appreciated!

    Vindaloo

  4. #4
    Registered User
    Join Date
    03-20-2006
    Location
    SE England
    Posts
    20
    Ok, I have found the problem (a lot sooner than I expected).

    The ComboBox has a linked cell.
    This linked cell is used as an argument in an INDEX worksheet function.
    One of the cells in the range used in the INDEX function contains a VLOOKUP worksheet function.
    The VLOOKUP function refers to a range which contains the cell I am changing which triggers the problem. Because this cell is the leftmost cell of the range, my guess is that Excel is determining that the linked cell of the Combobox is now potentially wrong and is triggering the Change event?

    Interestingly, if I remove the original error in the Change event so that it runs through, Excel then falls over and asks if I want to send an error report. I would have thought that Excel should be able to cope with what I'm doing.

    If anyone is interested, I can reproduce a simple version to demonstrate what's happening and then maybe you can tell me why it all falls over?

    Thanks,
    Vindaloo

+ 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