+ Reply to Thread
Results 1 to 8 of 8

How to Lock a Row

  1. #1
    Registered User
    Join Date
    02-05-2008
    Posts
    54

    Cool How to Lock a Row

    Hi

    Is it possible to lock a ROW (ie prevent users from changing entered data) from cols DQ:RZ depending on whether there is an “x” in col CA (of the same row).
    This is to start at row 14 and would end at row 380. Could you also show how to lock the entire row – as opposed from DQ:RZ.
    Apologies if this turns out to be VB. Im sure I will be told!

    Many Thanks
    Last edited by Shytott; 11-19-2012 at 09:54 AM.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: How to Lock a Row

    Untested

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-05-2008
    Posts
    54

    Re: How to Lock a Row

    Hi Bob

    Thanks for that. Ive tried entering your code onto the relevant sheet, but nothing happened. I tried with the sheet protected and unprotected.
    This is basically going to follow the months of the year so with DQ14 being 1st Jan therefore my first 'Lockout' of the year would have covered DQ14:RZ45. Sorry, my appreciation of coding isnt that advanced. Would you code cover this type of action?

    Cheers
    Supdem

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: How to Lock a Row

    You have to enter a value in CA to trigger it.

  5. #5
    Registered User
    Join Date
    02-05-2008
    Posts
    54

    Re: How to Lock a Row

    I have. There are "x"s all the way down to 30th September in CA14:CA287.

    Its coming back with a Compile Error, "Ambiguous name detected: Worksheet_Change", and the top line of your code is highlighted.

    Supdem

  6. #6
    Registered User
    Join Date
    02-05-2008
    Posts
    54

    Re: How to Lock a Row

    Ahhhh - I have discovered that cols QO:UU are now mysteriously locked! Is that significant?

    Regarding the Compile error, I have another bit of code with the exact same first line, so I presume Excel didnt like that. I changed yours to read "....Worksheet_Changed". Will it still work?

    Supdem

  7. #7
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: How to Lock a Row

    Nope, you have to merge them.

  8. #8
    Registered User
    Join Date
    02-05-2008
    Posts
    54

    Re: How to Lock a Row

    Hi Bob

    Ive mereged the two routines so that they dont crash out, but its still not locking the row or part of the row.

    Supdem

+ 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