Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Weird behavior on Worksheet_beforedoubleclick event (XL2003)

I wonder if you are seeing what I saw

http://74.125.113.132/search?q=cache...ient=firefox-a

--
HTH,

Barb Reinhardt



"ker_01" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Weird behavior on Worksheet_beforedoubleclick event (XL2003)

That sounds like it is probably the same thing- I'm not finding that the
final cell selection is at the end of a used range (it is all over the
place), and the cell contents don't have formulas, so it isn't referencing a
precedent cell... but I'll try the solution provided in this thread and
hopefully take care of it-

Thank you very much for the link, I didn't find this in my search prior to
posting.

Best,
Keith

"Barb Reinhardt" wrote:

I wonder if you are seeing what I saw

http://74.125.113.132/search?q=cache...ient=firefox-a

--
HTH,

Barb Reinhardt



"ker_01" wrote:

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Weird behavior on Worksheet_beforedoubleclick event (XL2003)

Well, it actually didn't work as well as I had hoped. I agree with you that
turning off draganddrop is a bad idea because users may have other workbooks
open, and I'd be interfering with the whole Excel application until my
workbook closed (putting d&d = true in the close event).

So instead I tried Jim's suggestion, and I keep getting a weird macro not
found error. For example:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.CellDragAndDrop = False
'Application.OnTime Now + TimeSerial(0, 0, 0.5), "ResetDragAndDrop"
Application.OnTime Now + TimeSerial(0, 0, 1),
Application.CellDragAndDrop = True
End Sub

At first I was using the separate ResetDragAndDrop procedure, but I was
getting the macro not found error. I thought maybe I could circumvent that by
just keeping everything in one sub, but now I'm getting the error that it
can't find the macro [path\]!False, as if it is looking for a sub called
"False". With continuous pop-ups, I think I'm better off going back the the
problem of random cell selection...

Thanks,
Keith

"Barb Reinhardt" wrote:

I wonder if you are seeing what I saw

http://74.125.113.132/search?q=cache...ient=firefox-a

--
HTH,

Barb Reinhardt



"ker_01" wrote:

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



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
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 02:17 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"