+ Reply to Thread
Results 1 to 16 of 16

Conditional cell lock

  1. #1
    Registered User
    Join Date
    05-15-2008
    Posts
    20

    Conditional cell lock

    Hi Friends, am in some serious problem and hope somebody would get me out from trouble here.I have an sheet(see attached) with some dummy data, now i want to lock (with password) only those cells depending on the dropdown (highlighted in sheet).For eg,if we select A from dropdown of col c and then locked from dropdown of col D , it should lock the complete row(s) of value A in col H and rows with value B shall remain editable.Am counting on you guys to put me on track and your help would be immensely appreciated.

    Thanks
    Ankur
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-15-2008
    Posts
    20

    conditional lock

    Hi , I typed in the following code for this problem.But still am not able to get the desired results.Any help from anybody??


    Please Login or Register  to view this content.
    Last edited by royUK; 05-29-2008 at 05:21 AM.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You can't use Target like that, Target refers to the cell(s) selected.

    Try this amended code
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    05-15-2008
    Posts
    20
    Hi roy, thanks for ur help, but am still facing issues with the sheet.If i put value A and B alternatively in col H ,the code doesn't work anymore.Hope i have made myself clear to you.Let me know should you require more information from my side.

    Ankur

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The code I gave you checks each cell in Column H of the table of data to see if it matches C2, if it does it will lock or unlock the cells based on the selection in D2

  6. #6
    Registered User
    Join Date
    05-15-2008
    Posts
    20
    Roy, Can i have urs workbook?? In my workbook its not working.....Thanks for your help

    Ankur

  7. #7
    Registered User
    Join Date
    05-15-2008
    Posts
    20
    Roy,

    Have attached the workbook with the mentioned code.pls help
    Attached Files Attached Files

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I can't download the workbook, try zipping it.

  9. #9
    Registered User
    Join Date
    05-15-2008
    Posts
    20
    I have winrar,will it work?

    Ankur

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    zip it with any program, even Windows XP

  11. #11
    Registered User
    Join Date
    05-15-2008
    Posts
    20
    Roy, Done the same as advised.Pls find the zipped file attached.
    Attached Files Attached Files

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I've changed the code slightly
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    05-15-2008
    Posts
    20
    Roy,

    You are amazing, the sheet looks what i wanted to be.Just one more help (sorry but may be am getting greedy:-))instead of selecting locked/unlocked from dropdown can we lock cells with the help of system time? To elaborate it further , i want rows marked A in col H to be locked between say 02:00 am till 10:00 am (only rows marked B in col H should be editable during that time) and rest of the time i.e from 10:01 am till 01:59am rows marked B in col H should be locked and rows marked A in col H should be editable now.I know am compounding your problems further but i would really appreciate if you can do it for me.let me know if you need more clarification/information.

    Thanks//Ankur

  14. #14
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by coolanks
    Roy,

    You are amazing, the sheet looks what i wanted to be.Just one more help (sorry but may be am getting greedy:-))instead of selecting locked/unlocked from dropdown can we lock cells with the help of system time? To elaborate it further , i want rows marked A in col H to be locked between say 02:00 am till 10:00 am (only rows marked B in col H should be editable during that time) and rest of the time i.e from 10:01 am till 01:59am rows marked B in col H should be locked and rows marked A in col H should be editable now.I know am compounding your problems further but i would really appreciate if you can do it for me.let me know if you need more clarification/information.

    Thanks//Ankur
    You have already asked this question

  15. #15
    Registered User
    Join Date
    05-15-2008
    Posts
    20
    I Did Roy, but am still to get any favourable response.Hope you would understand.

    Regards//Anks

  16. #16
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this, you might want to put it in the WorkBook_Open event or maybe sheet_activate.



    Please Login or Register  to view this content.

+ 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