+ Reply to Thread
Results 1 to 5 of 5

Lock Button that Locks Specific Cells

  1. #1
    mushman1
    Guest

    Lock Button that Locks Specific Cells

    Hello-

    This should be very simple, but I've run into an error:

    What's trying to be accomplished:
    - When user clicks on a button, VBA selects and locks a cell

    What's been done:
    - Very simple VBA code attached to a button:

    Please Login or Register  to view this content.
    Sheet/Book conditions:
    - The entire sheet is locked and protected with the exception of the cell (F6) and the button
    - When protecting, 'select unlocked sells' and 'format cells' are checked

    Current error I'm getting:
    Unable to set the Locked property of the range class

    This is very basic, and it has me stumped. Thoughts?

    Thx!
    Last edited by VBA Noob; 09-01-2008 at 05:46 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    mushman1,

    Welcome to the forum. Please read forum rules before posting again. I've wrapped your code for you.

    The code won't run on a protect sheet. See link for workaround

    http://www.ozgrid.com/VBA/excel-macr...cted-sheet.htm

    Also you don't need to select
    Please Login or Register  to view this content.
    VBA Noob
    Last edited by VBA Noob; 09-01-2008 at 05:53 PM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    mushman1
    Guest
    Thanks VBA Noob. Worked great and I see why you had me go back and read the forum rules.

    Thanks again.

  4. #4
    Registered User
    Join Date
    01-28-2015
    Location
    TX, USA
    MS-Off Ver
    2013
    Posts
    69

    Re: Lock Button that Locks Specific Cells

    I tried following the link to solve a very similar issue. Unfortunately the link takes me to a blank page. If someone would be so kind as to offer assistance I would greatly appreciate. I need to lock a series of cells, upon completion of the information. I know nothing about VBA.

  5. #5
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Lock Button that Locks Specific Cells

    You're posting in a thread from 2008.
    You need to start your own thread.

+ 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. protection of a workbook + unprotecting specific cells + calculation auto
    By choubix in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2008, 07:49 AM
  2. using VBA to hide columns and rows that do not have cells with a specific format
    By fecurtis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2008, 05:47 PM
  3. Lock different properties for different cells
    By seron in forum Excel General
    Replies: 6
    Last Post: 01-24-2007, 11:07 PM
  4. Replies: 1
    Last Post: 11-13-2006, 10:05 AM
  5. Getting range of cells with specific text colour, then using in a COUNTIF formulae
    By cheekyflash in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2006, 08:58 PM

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