I have a sheet where values are entered in column B and at the bottom is a Counta formula to count non blanks. I have put in a VBA code on the sheet to lock cells based on the total in that Counta field but it is not working. Is that because cell B38 has a formula in it?. Thanks in advance for any help
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B38") < 5 Then
Range("B3:B37").Locked = False
ElseIf Range("B38") > 5 Then
Range("B3:B37").Locked = True
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B38") < 5 Then
Range("B3:B37").Locked = False
ElseIf Range("B38") > 5 Then
Range("B3:B37").Locked = True
End If
End Sub