LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Weird behavior on Worksheet_beforedoubleclick event (XL2003)

I have some code that handles the doubleclick event on a target sheet
(relevant code pasted at the bottom of this post).

Approximately 30% of the time, when I try to double-click, the selected cell
(target) will randomly move to a different cell before my second click,
thereby not triggering the double-click event. It doesn't move my cursor; the
selected cell (highlighted) will actually suddenly jump to a different cell
leaving my cursor over my intended target cell. Example:

Cell E31 is selected (single click; the cursor is not within the cell so it
is not in edit mode)
I double click on cell D20 (very fast, inter-click delay is not an issue)
-the first click selects cell D20 ( the box around the cell highlights) as
expected
-the second click occurs, without moving the mouse
Some other random cell is selected, and my code does not fire.
While re-testing to write this email, once it jumped to cell D28, another
time it jumped to D11.

I've not had reason to use the double-click event before, and I've never
seen this behavior before- so I'm thinking that just having the double-click
event "enabled" may be causing problems. I can't see anything in my code that
would cause this behavior. I'm open to any ideas, because I'd really like to
get a reliable double-click on a target cell 100% of the time!

Note that I added the msgbox to confirm whether the code is firing- when the
selection jumps, I don't get the msgbox. When I do get the msgbox, the
everything processes as expected (userform and subsequent code all works fine)

Thanks,
Keith


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Msgbox "x"
If Target.Rows.Count = 1 And Target.Columns.Count = 1 Then
NameVal = Target.Value
If NameVal < "" And Target.Row 2 And (Target.Column = 3 Or
Target.Column = 4 Or Target.Column = 5) Then

UserForm1.show

End If
End If
End Sub



 
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
Worksheet_BeforeDoubleClick event question Barb Reinhardt Excel Programming 9 October 1st 09 05:02 PM
weird listbox behavior Bill Grigg Excel Programming 0 August 25th 08 03:42 PM
Weird Do...Until behavior... IT_roofer Excel Programming 0 May 23rd 07 06:34 PM
Weird range selection issue XL2003- help please! KR Excel Programming 3 April 28th 06 08:27 PM
Weird behavior of VLOOKUP John Simons Excel Programming 2 April 30th 05 02:21 AM


All times are GMT +1. The time now is 07:24 PM.

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

About Us

"It's about Microsoft Excel"