+ Reply to Thread
Results 1 to 3 of 3

Lock a row when not blank but also lock cells marked as locked

  1. #1
    Registered User
    Join Date
    02-22-2012
    Location
    Liverpool,England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    2

    Post Lock a row when not blank but also lock cells marked as locked

    I used this post: "Lock A Row With An Entry In Col B On Saving Or Closing Workbook" to assist me initially and with a bit of tinkering I got pretty much what I wanted. I want to lock the rows that have data entered and leave only the blank rows editable when I click save, but I also have columns within those rows which have formula that I want protecting all the time.

    I can unprotect the whole sheet, mark the cells I want locked as locked and then protect the sheet and it works. But then when I click save it locks the rows that are not blank as desired but unlocks the columns with formulas. It seems to me that I just need another line in the ThisWorkbook code which says protect the cells ticked for locking as well as the rows but I am unable to find.

    This is my code, please advise:

    Please Login or Register  to view this content.
    Last edited by rich101; 02-22-2012 at 10:07 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Lock a row when not blank but also lock cells marked as locked

    Please take a moment to read the forum rules and edit your post to include code tags.

    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Select your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button).
    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    02-22-2012
    Location
    Liverpool,England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    2

    Re: Lock a row when not blank but also lock cells marked as locked

    Apologies, I am new today. Done

+ 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