Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Before_Double_Click Event

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Before_Double_Click Event

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Before_Double_Click Event

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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Before_Double_Click Event

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
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
apply cell change event to single column - WorksheetChange Event [email protected] Excel Programming 6 May 4th 08 02:28 AM
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
How to trap delete row event and hide column event? Alan Excel Programming 3 April 26th 05 04:25 PM
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 06:44 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"