Form Click event...

J

John Keith

Why does the _click event fire when deleting a row?

Here is what I am attempting...
I have a WB with 2 tabs.
The first tab contains a table list with multiple categories. I have a
routine that sorts the list by categories then deletes all named ranges, then
creates named ranges for each of the categories.
The 2nd tab has code that detects a double click with-in certain cells to
trigger a show of a user form with a listbox that has a rowsource set to
match a category range (from the 1st tab). The user then clicks on one of
the lists choices that then populates 2 cells on the worksheet based on the
target cell that was dbl clicked.

the ListBox1_Click routine seems to fire erroneously when deleting a row
from the 1st tab - the table sheet (the user form was hidden (as opposed to
unloaded)) I was able to get around the issue by testing for the
activesheet.name and exiting the _click routine when the sheet is not the one
that uses the form. I also had to re-hide the form.
It seems like a hidden request to show the form was executed. Anyone know
why this happens? I want to make the code more efficient so events aren't
looping through the code needlessly.

I used STOP's at the top of my routines,the 1st one was the Listbox1_Click
routine that got control after deleting the row.

Any ideas?
 
T

Tom Ogilvy

Don't tie the rowsource to the 1st tab. Load it without binding it to the
sheet.
 

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