+ Reply to Thread
Results 1 to 4 of 4

Lock All Cells in Worksheet

  1. #1
    Forum Contributor
    Join Date
    09-13-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    111

    Lock All Cells in Worksheet

    Good Afternoon,

    This should be an easy one, and I'm a little embarrassed about not figuring it out.

    Is there a way that I can lock all of the cells in a worksheet without referencing the range of the worksheet? I was using the following code to do it before, but it magically stopped working. I'm getting a "Compile error" Method or data member not found" message. Here is the code:

    Please Login or Register  to view this content.
    The compile error is occurring on the "Locked" method. It was working before, but now it doesn't work. Strange.

    Thanks,
    Bob
    Last edited by Bob1980; 03-06-2015 at 05:09 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Lock All Cells in Worksheet

    I'm sorry to doubt you but I don't think that code ever worked. There is no Locked attribute available for a worksheet object. You want this:

    Please Login or Register  to view this content.
    What does this mean: "without referencing the range of the worksheet"?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Lock All Cells in Worksheet

    Hi Bob

    Try this (not tested)

    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    09-13-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    111

    Re: Lock All Cells in Worksheet

    You are right. Thanks, it's like my code is magically changing by it's self. Thanks a bunch.

    Bob

+ 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. How to lock cells in a protected worksheet
    By rbs123 in forum Excel General
    Replies: 2
    Last Post: 02-18-2015, 01:09 AM
  2. How to Lock Individual Cells in a Worksheet
    By sonu_kumar444 in forum Excel General
    Replies: 1
    Last Post: 07-23-2014, 02:58 AM
  3. Can I lock cells or do I have to lock the worksheet?
    By jmbtexas in forum Excel General
    Replies: 4
    Last Post: 11-11-2008, 02:26 PM
  4. Can I lock a set of cells in a worksheet?
    By puneetarora_12 in forum Excel General
    Replies: 3
    Last Post: 07-08-2005, 07:05 PM
  5. Replies: 4
    Last Post: 02-24-2005, 10:06 PM

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