+ Reply to Thread
Results 1 to 8 of 8

Lock entire column if data has been entered in it

  1. #1
    Registered User
    Join Date
    02-01-2014
    Location
    Veliko Turnovo
    MS-Off Ver
    Excel 2013
    Posts
    4

    Question Lock entire column if data has been entered in it

    Hi,
    I'm looking for a way to auto lock entire column if data is entered in it and after the workbook is closed.
    So in the attached file there is a range of cells (C3:M28; C31:M31; C34:M34) which are unlocked. Is there a way to lock cells in the entire column "C" (after I close and save the workbook) if data is entered in any unlocked cell in this column? Respectively lock the entire column "D" if data is entered in any cell in it, and so forth.

    Sorry if my English is bad and if my question is previously answered but I couldn't find a solution!
    Thanks in advance!
    Best regards!

    Book1.xlsx
    Last edited by bassterro; 02-01-2014 at 02:59 PM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Lock entire column if data has been entered in it

    Your sheet is protected with a password. Could you post the password?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    02-01-2014
    Location
    Veliko Turnovo
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Lock entire column if data has been entered in it

    Sorry, I forgot about that. I've changed the link in the first post with unlocked sheet.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Lock entire column if data has been entered in it

    Try this macro. Change "password" in the code to match yours.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-01-2014
    Location
    Veliko Turnovo
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Lock entire column if data has been entered in it

    Thank you, but just a quick question: where I have to put this code?

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Lock entire column if data has been entered in it

    Do the following: Hold down the ALT key and press the F11 key. This will open the Visual Basic Editor. In the menu at the top click 'Insert' and then click 'Module'. Copy and paste the macro into the empty code window that opens up. Press the F5 key to run the macro. Close the code module window to return to your sheet. There are other quicker ways to run the macro such as assigning it to a button that you would click on your sheet or assigning it to a short cut key.

  7. #7
    Registered User
    Join Date
    02-01-2014
    Location
    Veliko Turnovo
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Lock entire column if data has been entered in it

    Thank you so much, it works great!!!

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Lock entire column if data has been entered in it

    My pleasure.

+ 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. Auto-lock a row after data is entered
    By src16 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2013, 09:50 AM
  2. [SOLVED] Require a Macro to lock/unlock the related row if a value is entered in a column
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 38
    Last Post: 06-27-2012, 05:32 AM
  3. Lock the column once data is entered
    By anwitha in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-10-2011, 03:52 AM
  4. Lock date once data has been entered.
    By tommyis3 in forum Excel General
    Replies: 5
    Last Post: 09-02-2007, 03:07 PM
  5. Lock Data in Cell after entered
    By CrimsonPlague29 in forum Excel General
    Replies: 0
    Last Post: 05-09-2006, 06:55 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