Hi All,
I have a little bit of code that shows a userform as part of the BeforeRightClick event.
Once I have finished with the userform and hide it, is there a way to stop the Right-Click menu showing ?
Thanks
captHedge
Hi All,
I have a little bit of code that shows a userform as part of the BeforeRightClick event.
Once I have finished with the userform and hide it, is there a way to stop the Right-Click menu showing ?
Thanks
captHedge
Create a public variable and set it to false on closing the form, and test it in the event code.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
[VBA]
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
MsgBox "No Right-Clicking!", vbOKOnly + vbInformation, "My Excel Events"
Cancel = True
End Sub
[/VBA]you can put the two lines (msgbox optional) at the end of the code in the module!
Regards,
BG.
Thanks for that...
In the end, all I did was add this to the event
[VBA]cancel = TRUE[/VBA]
before I called the userform and viola, the standard menu was cancelled at the end.
Thanks again