How can I disable right click on an excel sheet? It should display message saying "Command not allowed .."
Thanks.
~BS
How can I disable right click on an excel sheet? It should display message saying "Command not allowed .."
Thanks.
~BS
Copy this macro to the code page of the worksheet you want to diable the Right-Click event:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
Cancel As Boolean)
Cancel = True
Dim msg, title, style
' Define user dialog parameters
msg = "Command not allowed."
style = vbOKOnly + vbExclamation + vbDefaultButton1
title = "Invalid User Action"
' Display user dialog
Response = MsgBox(msg, style, title)
End Sub
Hope this helps,
theDude
Cool. This code works great. Is there a similar way for left click too so that a message is displayed or procedure is run when user clicks a menu item like File or Edit.
Thanks
~bhavesh
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks