+ Reply to Thread
Results 1 to 2 of 2

locking/protecting specific range

  1. #1
    Registered User
    Join Date
    10-10-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    58

    locking/protecting specific range

    hello everyone,

    i have written the folllowing code:

    Sub ppppppppppppp()

    Worksheets("sheet1").Range("a4:a20").Locked = True
    ActiveSheet.Protect Password:="enter your password"



    End Sub

    i just want to be able to lock the specific range e.g. [Range("a4:a20")], but instead it is protecting/locking the whole worksheet. can someone help/explain to me why it won't let me lock my specific cells/range? thanks

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: locking/protecting specific range

    Hi,
    1) is your activesheet Sheet1? if not you shall do both (locking cells and protecting sheet) on the same sheet
    2) are other cells unlocked? if not correct it
    3) important note: please use code tags as required by our forum rules (edit your post). see http://www.excelforum.com/forum-rule...rum-rules.html



    Please Login or Register  to view this content.
    Best Regards,

    Kaper

+ 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. locking and protecting
    By DENWARD in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-01-2014, 04:23 PM
  2. Locking and Protecting questions
    By DENWARD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2014, 05:47 PM
  3. Locking and protecting
    By CornCrib in forum Excel General
    Replies: 1
    Last Post: 06-28-2011, 05:47 PM
  4. Locking few cells without Protecting Sheet
    By crapmind in forum Excel General
    Replies: 2
    Last Post: 06-18-2007, 06:48 PM
  5. Locking/Protecting Rows
    By SJT in forum Excel General
    Replies: 2
    Last Post: 07-06-2006, 11:40 AM

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