+ Reply to Thread
Results 1 to 14 of 14

How to Lock entire Row if the cell value in G=0 using VBA.

  1. #1
    Registered User
    Join Date
    03-06-2012
    Location
    Maharashtra
    MS-Off Ver
    Excel 2007
    Posts
    15

    How to Lock entire Row if the cell value in G=0 using VBA.

    How Lock entire Row if the cell value in “N” column =0, else respective row for which value in "N" column is not equal to 0 should be open to edit. Using VBA even cut paste should not work for the locked cells.

    Please help if it’s possible. The file is attached.

    Book2.xlsx
    Last edited by Sanoj; 03-12-2012 at 08:16 AM.

  2. #2
    Registered User
    Join Date
    03-06-2012
    Location
    Maharashtra
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Any help.....?????? Its little urgent......

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Hi

    You want, only VBA? I think that you can do it, using Custom Validation.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

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

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    03-06-2012
    Location
    Maharashtra
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    But I tried using Custom validation option but by that we can still amend by copy paste function or even we can delete the value in the locked cells, I thought VBA is better option.

    Please let me know if it’s possible.

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Using Custom Validation, JUST lock the range and don't allow to the user to type something if you don;t want to do this.

    User can delete the values and also can do copy-paste...

  6. #6
    Registered User
    Join Date
    03-06-2012
    Location
    Maharashtra
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Hi Thanks for your reply but I am not sure how to do it. I dont know how to lock the cells using custom validation.
    Can you please help me by showing it in the attached sheet... Book2.xlsx

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Hi

    Take a look to the sample.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-06-2012
    Location
    Maharashtra
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Thanks for your help but I am able to type in all the cells... Book2(1).xls

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    ...I had lock, ONLY column A.

    Look now...
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-06-2012
    Location
    Maharashtra
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Yes we cannot enter data but we can paste and delete data from the locked cell which i want to prevent.

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    ...User can delete the values and also can do copy-paste...
    This is a piece from my answer in Post#5.

    And now you tell me again the same.

    Yes we cannot enter data but we can paste and delete data from the locked cell which i want to preven
    t.

    I told you, Just don't allow to type anything. Just this!!

  12. #12
    Registered User
    Join Date
    03-06-2012
    Location
    Maharashtra
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Yes right, Thats the reason I was looking for a VBA Coding...
    Last edited by Sanoj; 03-12-2012 at 10:21 AM.

  13. #13
    Registered User
    Join Date
    03-06-2012
    Location
    Maharashtra
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Any help with VBA Coding???

  14. #14
    Registered User
    Join Date
    03-06-2012
    Location
    Maharashtra
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: How to Lock entire Row if the cell value in G=0 using VBA.

    Any help??????

+ 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