+ Reply to Thread
Results 1 to 4 of 4

Need to lock a macro button

  1. #1
    Registered User
    Join Date
    06-29-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    14

    Need to lock a macro button

    I have 2 macro buttons in my spreadsheet (excel 2007). One is to hide columns and the other is to unhide them. I need to lock these buttons so that they cannot be executed by anyone except myself. I do NOT want to protect the entire sheet, as there are filters on all of the columns that can be used by others members of my team.

    Any suggestions??!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Need to lock a macro button

    You might try testing the value of Application.UserName as the first line in your procedure and exiting if it is not you.
    Martin

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,317

    Re: Need to lock a macro button

    Use an InputBox early on in the button code to request a password. You'll need to password protect the project.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    06-29-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Need to lock a macro button

    Sorry...I don't understand. I guess that I should mention that I am a bit green when it comes to Excel.... Please explain - thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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