Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I was tring to lock cell if value of corresponding cell is error
If value B3:B20 is error lock corresponding cells in ColumnE, F & H OR unlock cell if value of corresponding cell is 0 If value B3:B20 is 0 unlock corresponding cells in ColumnE, F & H |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Putting this module into the individula sheet in the VBA editor will lock or
unlock the cells everytime the sheet is changed. Sub Worksheet_Change(ByVal target As Range) ActiveSheet.Unprotect For B = 3 To 20 If IsError(Cells(B, 2)) Then Cells(B, 5).Locked = True Cells(B, 6).Locked = True Cells(B, 8).Locked = True Else If Cells(B, 2) 0 Then Cells(B, 5).Locked = False Cells(B, 6).Locked = False Cells(B, 5).Locked = False End If End If Next B ActiveSheet.Protect End Sub or you could tie this same routine to a button if you only want to run it on demand. -- If this helps, please remember to click yes. "Kashyap" wrote: Hi, I was tring to lock cell if value of corresponding cell is error If value B3:B20 is error lock corresponding cells in ColumnE, F & H OR unlock cell if value of corresponding cell is 0 If value B3:B20 is 0 unlock corresponding cells in ColumnE, F & H |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Lock Cells based on Data in another cell | Excel Programming | |||
lock a cell based on cell value | Excel Discussion (Misc queries) | |||
lock cell based on a condition | Excel Worksheet Functions | |||
Lock data in a cell a specific cell based on selection on other ce | Excel Worksheet Functions | |||
How to lock a row in a spreadsheet based on the value in a cell | Excel Worksheet Functions |