+ Reply to Thread
Results 1 to 2 of 2

Locking cells until conditional formatting rules return false

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Locking cells until conditional formatting rules return false

    Hello,

    I have a workbook that uses this conditional formatting (=OR($A2="",$E2="",$E2="mm/dd/yy")) in a table with ranges A:E.

    I have a column F that read: "Read to transfer? y or n?"

    Is there a way to not allow a user to type 'y' or 'n' until the conditional formatting is no longer applied to that row?

    I have attached the workbook.

    Please help!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: Locking cells until conditional formatting rules return false

    Hi, So I've tried something like this, and i'm not getting any errors: but the cells aren't locking.. any ideas?

    Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Target, Range("B1:F100")) Is Nothing Then
        If Range("B" & Target.Row) = "" And Range("C" & Target.Row) = "" And Range("D" & Target.Row) = "" Then
            Range("A" & Target.Validation).Delete
        Else
            With Range("A" & Target.Row).Validation
                .Delete
                .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
                xlBetween, Formula1:= _
                "=IF(NOT(AND(B" & Target.Row & "="""",C" & Target.Row & "="""",D" & Target.Row & "="""",E" & Target.Row & "="""")),Priority,"""")"
            End With
        End If
        
        If Range("A" & Target.Row).Value = "" Or Range("E" & Target.Row).Value = "mm/dd/yy" _
            Or Range("E" & Target.Row).Value = "" Then
                Range("F" & Target.Row).Locked = True
        Else
                Range("F" & Target.Row).Locked = False
        End If
    
    End If
     
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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