+ Reply to Thread
Results 1 to 19 of 19

Lock the column on Specific Text Based

  1. #1
    Forum Contributor
    Join Date
    02-17-2014
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    320

    Lock the column on Specific Text Based

    Hello Friends..........

    is it possible to lock the entire row (means Readonly) if i type Locked and if i type unlocked then we can make changes in the row......

    for better understand i am uploading a sample file please see the file

    Column-A to J have some data.............

    1. i want when i type "Locked" in Col-K then the entire row should be Uneditable.......
    2. And it should be editable when i type "Unlocked" thats it

    see the sample file
    Attached Files Attached Files

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Lock the column on Specific Text Based

    Quote Originally Posted by AVG123 View Post
    1. i want when i type "Locked" in Col-K then the entire row should be Uneditable.......
    Quote Originally Posted by AVG123 View Post
    2. And it should be editable when i type "Unlocked" thats it
    How can you type anything in uneditable cell?
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    02-17-2014
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    320

    Re: Lock the column on Specific Text Based

    Only Col K should remain editable

  4. #4
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Lock the column on Specific Text Based

    Hi AVG123

    For a very simple solution that doesn't require protection or locking, you could just make sure that the User cannot select a cell in any row that had "Locked" in column [E] of that row.

    The code for this is:
    Please Login or Register  to view this content.
    ..see attached workbook to see this working

    zeddy
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Lock the column on Specific Text Based

    Right Click On Your Sheet Name At the Bottom Of Excel and Select View Code
    Paste this code in the module that opens and close it.


    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  6. #6
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Lock the column on Specific Text Based

    Hi AVG123

    ..note I used your sample file which had column [E] for the Locked/Unlocked setting.
    You can see that this is easy to change to any other column as you require e.g. column [K] etc etc etc

    zeddy

  7. #7
    Forum Contributor
    Join Date
    02-17-2014
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    320

    Re: Lock the column on Specific Text Based

    Sir it is not working

  8. #8
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Lock the column on Specific Text Based

    Hi

    I like the brevity of mehmetcik's code, but I would use..
    Please Login or Register  to view this content.
    zeddy

  9. #9
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Lock the column on Specific Text Based

    Hi AVG123

    ..when you load my posted sample file, you need to have macros enabled.

    zeddy

  10. #10
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Lock the column on Specific Text Based

    Hi AVG123

    ..and then just move the cellpointer around to see what happens.

    zeddy

  11. #11
    Forum Contributor
    Join Date
    02-17-2014
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    320

    Re: Lock the column on Specific Text Based

    Nothing is working something missing

  12. #12
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Lock the column on Specific Text Based

    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    02-17-2014
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    320

    Re: Lock the column on Specific Text Based

    When i typed from Locked to Unlocked........after that it is again uneditable

  14. #14
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Lock the column on Specific Text Based

    Hi AVG123

    Are you having problems with my posted file???
    I have tested this before posting.
    So, in case you have turned event-tracking OFF I suggest you start again by coming out of Excel completely, then starting a new Excel session, then loading my posted file with macros enabled, then testing it by moving the cellpointer about.

    zeddy

  15. #15
    Forum Contributor
    Join Date
    02-17-2014
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    320

    Re: Lock the column on Specific Text Based

    Giving error 1004 "Select method of Range class failed"

  16. #16
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Lock the column on Specific Text Based

    Hi AVG123

    ..with my posted file, you can change the setting from Locked to Unlocked on any row.
    When a row setting in column [E] is set to "Locked", you cannot move the cellpointer to any cell on that row (other than column E) and so you cannot edit any cell to change it.
    If you change the setting in column E to anything other than "Locked", it will immediately allow you to select/edit any cell in that row.

    zeddy

  17. #17
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Lock the column on Specific Text Based

    Hi AVG123

    I downloaded the file I posted and tested it OK in Excel2010 and tested OK in Excel2016

    ..something else is interfering at your end.
    ..you may have some other add-ins loaded or you are not using the file I posted.

    zeddy

  18. #18
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Lock the column on Specific Text Based

    Quote Originally Posted by AVG123 View Post
    When i typed from Locked to Unlocked........after that it is again uneditable
    Before you run it please be sure than col E is unlocked/unhidden in properties then works 100%.

  19. #19
    Forum Contributor
    Join Date
    02-17-2014
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    320

    Re: Lock the column on Specific Text Based

    Thanks sir it is working ............if you don't mind can you alter your program
    i want when anyone change from Locked to Unlocked or Unlocked to Locked always prompt a Password to change it.........

+ 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. [SOLVED] Find Last Column with Data in Specific Row based on text
    By koticphreak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2020, 08:37 PM
  2. Replies: 4
    Last Post: 07-22-2019, 06:21 PM
  3. How to countif a specific column based on a cell text value.
    By JamesBlack90 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-24-2015, 07:46 AM
  4. [SOLVED] Lock a cell based on a specific criteria
    By distortthecode in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-29-2014, 08:44 AM
  5. [SOLVED] Can you calculate columns based on specific text in a different column?
    By CenterShock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-16-2014, 03:52 PM
  6. Counting Text based on specific criteria in another column
    By djreddy in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 08-26-2013, 09:35 AM
  7. Need Help w/Macro That Will Insert Column Based on Specific Text in a Given Cell
    By pb6933944 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-23-2012, 12:23 PM

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