Home |
Search |
Today's Posts |
#2
![]() |
|||
|
|||
![]()
This can be achieved through a macro, however, you would need to store the
password in the macro to unlock the sheet in order to make the changes - assuming you have locked the sheet. You would need to write the code in the VBA object for the sheet in question, then using the macro: Private Sub Worksheet_Change(ByVal Target As Range) 'find if condition is met for the cells in question then lock the cell ' assuming the cells in question are in B1:B5 Activesheet.Unprotect Password:="myPassword" With ActiveSheet.Range("B1:B5") For i = 1 to .Rows.Count If .Cells(i, 1).Value 10 Then .Locked = True End If Next I End With Activesheet.Protect Password:="myPassword" End Sub "Gyges" wrote: In Excel, is there anyway to protect a cell only if it meets a certain condition? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional formating - cell protection | Excel Discussion (Misc queries) | |||
Conditional formatting row if cell value in certain column is even | Excel Worksheet Functions | |||
Excel: how to formulate conditional cell references | Excel Worksheet Functions | |||
conditional formatting blank cell | Excel Discussion (Misc queries) | |||
GET.CELL | Excel Worksheet Functions |