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

I have a code like this

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Target.Offset(0, 1) = Target

End Sub

in spite of cancel=true statement when I right click the target, the submenu
comes up and so the event code does not work. where is the mistake.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default worksheet_beforerigthclick event

the cancel=true shouldn't be necessary but you will need to put in the SHEET
module instead of a regular module or ThisWorkbook module

--
Don Guillett
SalesAid Software

"R..VENKATARAMAN" wrote in message
...
I have a code like this

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Target.Offset(0, 1) = Target

End Sub

in spite of cancel=true statement when I right click the target, the
submenu comes up and so the event code does not work. where is the
mistake.





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

Is the code behind the correct worksheet?

Have you disabled events and not re-enabled them?



"R..VENKATARAMAN" wrote:

I have a code like this

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Target.Offset(0, 1) = Target

End Sub

in spite of cancel=true statement when I right click the target, the submenu
comes up and so the event code does not work. where is the mistake.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default worksheet_beforerigthclick event

If the OP doesn't want to see the Cell menu after rightclicking, won't he need
that "cancel = true" line?

Don Guillett wrote:

the cancel=true shouldn't be necessary but you will need to put in the SHEET
module instead of a regular module or ThisWorkbook module

--
Don Guillett
SalesAid Software

"R..VENKATARAMAN" wrote in message
...
I have a code like this

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Target.Offset(0, 1) = Target

End Sub

in spite of cancel=true statement when I right click the target, the
submenu comes up and so the event code does not work. where is the
mistake.




--

Dave Peterson
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default worksheet_beforerigthclick event

thanks all of you. I checked again in a new workook the macro is ok.
previous time also I placed the macro only in the worksheet event
module nolt in the standard module.. But the excel sheet was sent by
somebody. I dont know whether he/she has done some enableevents .
anyhow it is ok in my sheet. thank you once again all of you. the doubt
is cleared.
venkat


Don Guillett wrote:
Yeah. my bad

--
Don Guillett
SalesAid Software

"Dave Peterson" wrote in message
...
If the OP doesn't want to see the Cell menu after rightclicking, won't he
need
that "cancel = true" line?

Don Guillett wrote:

the cancel=true shouldn't be necessary but you will need to put in the
SHEET
module instead of a regular module or ThisWorkbook module

--
Don Guillett
SalesAid Software

"R..VENKATARAMAN" wrote in message
...
I have a code like this

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Target.Offset(0, 1) = Target

End Sub

in spite of cancel=true statement when I right click the target, the
submenu comes up and so the event code does not work. where is the
mistake.




--

Dave Peterson


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
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 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
Event Procedures: Event on Worksheet to fire Event on another Worksheet Kathryn Excel Programming 2 April 7th 04 07:35 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:58 PM.

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

About Us

"It's about Microsoft Excel"