Results 1 to 3 of 3

Lock specific rows with a drop down box

Threaded View

  1. #1
    Registered User
    Join Date
    05-06-2014
    Location
    North Ogden, UT
    MS-Off Ver
    Excel 2003
    Posts
    8

    Exclamation Lock specific rows with a drop down box

    I have a spreadsheet with data entered in columns A thru N. Columns are locked except for F,G,K,M, and N which data must be entered manually. In column O, I have a drop down box with "closed" in it. I want to lock the rest of the row (so if row in row 9, for example it would lock F9,G9,K9,M9, and N9) once the word "closed" is inserted with the drop down box. Anyone know how I could do this? I am currently using a macro but it doesn't work unless the sheet is unlocked. Thanks in Advance.

    Macro currently used:
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    'if more than 1 cell is changed or changed cell is not
    'in column O, end macro (do nothing)
    If Target.Cells.Count > 1 Or _
    Intersect(Target, [O:O]) Is Nothing Then Exit Sub
    
    'unprotect the sheet
    ActiveSheet.Unprotect
    
    'if value in column O is "Closed," lock all cells in that row
    If Target = "Closed" Then Rows(Target.Row).Locked = True
    
    'protect the sheet
    ActiveSheet.Protect
    
    End Sub
    Last edited by Fotis1991; 05-07-2014 at 12:56 PM. Reason: Pls use code tags around your codes!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Lock specific cells once a value is entered with a drop down list
    By MissDB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-26-2014, 08:41 AM
  2. Replies: 12
    Last Post: 05-28-2013, 08:48 AM
  3. Replies: 0
    Last Post: 05-27-2011, 12:01 PM
  4. How to lock the 1st drop down list
    By excelgreen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-21-2011, 07:08 PM
  5. Lock specific rows while inserting new rows
    By Wedge120 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2008, 10:00 AM

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