Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Form Click event...

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?
--
Regards,
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Form Click event...

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

--
Regards,
Tom Ogilvy


"John Keith" wrote:

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?
--
Regards,
John

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click event on menu item is lost after first time firing of the event [email protected] Excel Programming 1 April 2nd 07 01:25 PM
Form Dropdown: click event macro Carolyn Excel Programming 3 September 21st 06 07:32 PM
Right click event Dev Excel Programming 3 July 5th 06 11:27 PM
userform label double-click goes to click event John Paul Fullerton Excel Programming 3 May 19th 06 05:54 PM
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM


All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"