Is there a way to dissable the right click & page set up? I still want to be able to right click, but conditionally turn off page setup availability when right clicked.
Thanks.
Is there a way to dissable the right click & page set up? I still want to be able to right click, but conditionally turn off page setup availability when right clicked.
Thanks.
I hope this will help
[VBA]
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True 'disables the right click menu'
** your code here**
end sub
[/VBA]
hi mbm123, I need this to happen due to a specific cell > a given number. If that cell = 10 as an example I want to dissable all possibilities of page set up. I currently hide the toolbar which renders using that option unavailable, but if they right click, they are able to select page setup fro that.
So I need to dissable the right click based on criteria.
In that case just add an If statement
[VBA]
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
if range("YOUR CELL").value > NUM then
Cancel = True 'disables the right click menu'
end if
** your code here**
End Sub
[/VBA]
Did i understand it right?
Ahhh, that works. Thanks you