Consulting

Results 1 to 5 of 5

Thread: dissable richt click page setup

  1. #1
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location

    dissable richt click page setup

    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.

  2. #2
    VBAX Regular
    Joined
    Dec 2010
    Posts
    14
    Location
    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]

  3. #3
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location
    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.

  4. #4
    VBAX Regular
    Joined
    Dec 2010
    Posts
    14
    Location
    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?

  5. #5
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location
    Ahhh, that works. Thanks you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •