VBA code: Lock or unlock cells based on values in another cell Private Sub Worksheet_Change(ByVal Target As Range)ģ. Then copy and paste the following VBA code into the Code window. Right click the sheet tab (the sheet with cells you need to lock or unlock based on values in another cell), and click View Code from the right-clicking menu.Ģ. The following VBA code can help you lock or unlock cells based on value in another cell in Excel.ġ. Lock or unlock cells based on values in another cell with VBA code How can you do to achieve it? This article can help you. For example, you need the range B1:B4 to be unlocked if cell A1 contains value “Accepting” and to be locked if cell A1 contains value “Refusing”. In some cases, you may need to lock or unlock cells based on values in another cell. How to lock or unlock cells based on values in another cell in Excel?
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |