Results 1 to 7 of 7

Locking only certain cells on worksheet

Threaded View

Mum-O-Killowe Locking only certain cells on... 02-02-2014, 06:04 PM
Richard Buttrey Re: Locking only certain... 02-02-2014, 06:19 PM
Mum-O-Killowe Re: Locking only certain... 02-02-2014, 06:36 PM
Richard Buttrey Re: Locking only certain... 02-02-2014, 07:48 PM
Mum-O-Killowe Re: Locking only certain... 02-02-2014, 11:45 PM
Richard Buttrey Re: Locking only certain... 02-03-2014, 01:08 PM
Mum-O-Killowe Re: [SOLVED] Locking only... 02-03-2014, 02:07 PM
  1. #1
    Registered User
    Join Date
    02-01-2014
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    10

    Locking only certain cells on worksheet

    I have a workbok where I added 3 comboboxes that are positioned over 3 merged cells that are C6, C7, & C8. The comboboxes populate C6-C8 and C9 is just entered normally. I have a button on another page that toggles the visibility of the three comboboxes and locks the range C3:C9. It is working but I'm not getting it to unlock the range if the button is pressed again. code I'm using. I still want to be able to edit the rest of the sheet which seems to be working just not my range after the second button push.

    Sheets("Sheet1").Activate
        ActiveSheet.Range(Cells(6, 3), Cells(9, 3)).Select
        If Selection.Locked = False Then
         Selection.Locked = True
        ElseIf Selection.Locked = True Then
         Selection.Locked = False
         End If
    I get the error "Unable to set the Locked Property of the Range Class." on the second button push and Debug highlights the "Selection.Locked = False" after the ElseIf.

    Can anyone point me to something to read or suggest something to address this?

    Thanks for any help,

    Mum-O-Killowe
    Last edited by Mum-O-Killowe; 02-03-2014 at 01:59 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Locking specific cells eventually changing to locking all cells
    By davidingilbert in forum Excel General
    Replies: 1
    Last Post: 03-19-2013, 06:50 PM
  2. Creating New Worksheet from another Worksheet while locking formulas
    By DataVanMan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2012, 04:15 PM
  3. Help with macro, automatical locking cells when excel is closed but only locking 1 sh
    By snoopy1461 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2011, 11:29 AM
  4. [SOLVED] Macro for locking cells after worksheet is protected
    By Hugo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2006, 04:05 PM
  5. [SOLVED] locking formula in cells in without locking whole sheet
    By SuziQ in forum Excel General
    Replies: 1
    Last Post: 07-21-2006, 11:05 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