View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Before Right Click event

In a Module:
Public Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As
Integer

In the Worksheet:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
MsgBox "BeforeRightClick"
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not CBool(GetKeyState(vbKeyRButton) And &H8000) Then _
MsgBox "SelectionChange"
End Sub


"mohsinb" wrote in message
...
Rob,

Just to clarify further, is there a way of knowing that the
selectionchange is being fired by a right-click ?. if i could trap that
then I could arrange my logic.


---
Message posted from http://www.ExcelForum.com/