worksheet_beforerigthclick event

R

R..VENKATARAMAN

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.
 
D

Don Guillett

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
 
D

Dave Peterson

Is the code behind the correct worksheet?

Have you disabled events and not re-enabled them?
 
D

Dave Peterson

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

venkat1926

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top