+ Reply to Thread
Results 1 to 7 of 7

Disable Right click on Macro Button in a worksheet

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    36

    Disable Right click on Macro Button in a worksheet

    Dear All

    I would like to know if there is a way in which we can disable right click over a macro button or any button in a sheet? I have tried below, but only disables right click

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

    Kindly help with your valuable ideas and suggestions friends

    Regards

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Right click on Macro Button in a worksheet

    Protect the worksheet
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    07-26-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Disable Right click on Macro Button in a worksheet

    Hi Hans

    Thanks for the response. My only issue is I will need to copy /paste certain data into the sheet and then run the macro. So from the protect shetoption, which options i need to tick to get no right click on macro button? Plz a advise

    Thanks

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Right click on Macro Button in a worksheet

    According to me there is no specific option for that.
    Just make sure the cells where you will be pasting data are not locked when the worksheet is protected, make sure that other requirements like sorting autofilter etc are accessible and when the sheet is protected right click is not permitted on a button.

  5. #5
    Registered User
    Join Date
    07-26-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Disable Right click on Macro Button in a worksheet

    Thanks Hans, my other question is, how do i lock only the top 7 rows and the rest all unlocked in sheet? I have checked the buttons and with your option it doesnt shows right click !! thanks you are a genius!!

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Disable Right click on Macro Button in a worksheet

    I don'w know how large you 'free'area is but you can select all cells (Ctlr + A) and right click remove the locked checkmark.
    Then select the top 7 rows and x columns and right click and set the checkmark in locked.
    Protect the worksheet (with or without password) and remove the checkmark select locked cells) that's it.
    It's all in Excel help, no rocket science here.

  7. #7
    Registered User
    Join Date
    07-26-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Disable Right click on Macro Button in a worksheet

    Great thanks Hans

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Disable or hide a recorded macro button when clicked if the worksheet is protected
    By sai19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-31-2014, 12:14 PM
  2. Disable Right Click for Macro Button in excel sheet
    By gorkikumar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2013, 08:08 AM
  3. disable command button after a click.
    By arungm30977 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-21-2013, 09:04 PM
  4. [SOLVED] Disable ALL Buttons on Button Click in UserForm
    By Nu2Java in forum Excel General
    Replies: 2
    Last Post: 10-05-2012, 02:58 PM
  5. [SOLVED] Click button in one worksheet to activate Macro in another
    By guvner5 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2012, 11:39 AM
  6. Disable Button after one click user wise
    By Keerthivasan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2011, 11:00 AM
  7. Protect a Worksheet (Disable Macro Button)
    By PRodgers in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2009, 10:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1