PC Review


Reply
Thread Tools Rate Thread

Before_Double_Click Event

 
 
Paul Menhennett
Guest
Posts: n/a
 
      15th Oct 2009
I have some code that toggles between two values (Yes/No) when the user
double clicks the cell. The problem is, it only works once, then you have to
leave the cell and come back for it to work again. Is there a programmatic
way to reset the cell to the predouble click state so it will accept this
event again. I have tried activating another cell and then reactivating this
cell but it does no good. And another question. Why are there so few events?
No click events no mouse up,down, move and cells are not objects.
Thanks
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      15th Oct 2009
Remember to Cancel (editting) in the flip-flop:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
If Target.Value = "yes" Then
Target.Value = "no"
Cancel = True
Exit Sub
End If
Target = "yes"
Cancel = True
End Sub
--
Gary''s Student - gsnu200907


"Paul Menhennett" wrote:

> I have some code that toggles between two values (Yes/No) when the user
> double clicks the cell. The problem is, it only works once, then you have to
> leave the cell and come back for it to work again. Is there a programmatic
> way to reset the cell to the predouble click state so it will accept this
> event again. I have tried activating another cell and then reactivating this
> cell but it does no good. And another question. Why are there so few events?
> No click events no mouse up,down, move and cells are not objects.
> Thanks

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      15th Oct 2009
I've never seen that happen.

Maybe you're not doubleclicking fast enough or maybe even too fast.

This worked for me:

Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
MsgBox "hi"
Cancel = True 'stop the editing in cell
End Sub

If this doesn't help, you may want to share your procedure.




Paul Menhennett wrote:
>
> I have some code that toggles between two values (Yes/No) when the user
> double clicks the cell. The problem is, it only works once, then you have to
> leave the cell and come back for it to work again. Is there a programmatic
> way to reset the cell to the predouble click state so it will accept this
> event again. I have tried activating another cell and then reactivating this
> cell but it does no good. And another question. Why are there so few events?
> No click events no mouse up,down, move and cells are not objects.
> Thanks


--

Dave Peterson
 
Reply With Quote
 
Paul Menhennett
Guest
Posts: n/a
 
      15th Oct 2009
Thank you.
Solved my problem.

"Gary''s Student" wrote:

> Remember to Cancel (editting) in the flip-flop:
>
> Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
> Boolean)
> If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
> If Target.Value = "yes" Then
> Target.Value = "no"
> Cancel = True
> Exit Sub
> End If
> Target = "yes"
> Cancel = True
> End Sub
> --
> Gary''s Student - gsnu200907
>
>
> "Paul Menhennett" wrote:
>
> > I have some code that toggles between two values (Yes/No) when the user
> > double clicks the cell. The problem is, it only works once, then you have to
> > leave the cell and come back for it to work again. Is there a programmatic
> > way to reset the cell to the predouble click state so it will accept this
> > event again. I have tried activating another cell and then reactivating this
> > cell but it does no good. And another question. Why are there so few events?
> > No click events no mouse up,down, move and cells are not objects.
> > Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007. Event ID 25, Event ID 2000. Microsoft Office 12. Event ID 2001 David F. Sage Microsoft Outlook Discussion 0 10th Mar 2008 01:24 PM
Event ID: 1003, Event Type: Error ,Event Source: System Error,Event Category: (102) BoazBoaz Windows XP General 0 21st Jun 2006 05:39 PM
I need to clear temporary the event sinks from another event and then restore them, but I don't know which methods signed up for that event Serge Shimanovsky Microsoft Dot NET 1 14th Apr 2005 05:37 AM
I need to clear temporary the event sinks from another event and then restore them, but I don't know which methods signed up for that event Serge Shimanovsky Microsoft Dot NET Framework Forms 14 7th Feb 2005 08:48 PM
I need to clear temporary the event sinks from another event and then restore them, but I don't know which methods signed up for that event Serge Shimanovsky Microsoft Dot NET 0 11th Jan 2005 02:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:00 AM.