sheet event procedure

  • Thread starter Thread starter R.VENKATARAMAN
  • Start date Start date
R

R.VENKATARAMAN

I have prepared three userforms. sheet2 event procedure is beforerightclick
and it opens userform1. Each userform has commandbutton to open the next
one and hide the previous one. after all the userforms are operated the code
is made to comeback to sheet2. But right click of sheet2 brings in the
quick menu initially and it stays even after the code makes it to comeback
to sheet2. I have to hit <esc> or click some other cell to close the quick
menu . Is there any way to close the quick menu automatically. This may be
a simple query for an expert but for me the way out escapes me;

my last code statment is (this is a commandbutton)

Private Sub go_back_to_sheet2_Click()
userform3.Hide
Worksheets("sheet2").Activate
End Sub

mine is excel2000 windows98
thanks and regards
 
In the sheet's event handler, make sure that you set
Cancel = True ...this prevents the menu popup from opening

eg

Private Sub Worksheet_BeforeRightClick(ByVal Target As
Range, Cancel As Boolean)
Cancel = True
UserForm1.Show
End Sub

Patrick Molloy
Microsoft Excel MVP
 
thank you Mr. Patrick Molly. That means I have to carefully study the
arguments.
 

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

Back
Top