Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MsgBox in Enter event causes combobox not to run Change event | Excel Programming | |||
How to trap delete row event and hide column event? | Excel Programming | |||
user form-on open event? keydown event? | Excel Programming | |||
Event Procedures: Event on Worksheet to fire Event on another Worksheet | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming |