Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
unlock cell based on formula
I have a drop down menu titled "Reason" in Column A. Column B is protected
(locked). When the "other" seletion is made, I want to be able to unlock the cell to the right so that someone can enter a reason. Can this be done with either a formula or VBA? Thanks! huber57 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
unlock cell based on formula
Depends on how you made the dropdown and what version of excel you're using.
I'm gonna guess that you used Data|validation for the dropdown and you're not using xl97. If these are true, then right click on the worksheet tab that should have this behavior and select view code. Then paste this code into the code window: Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim myPWD As String myPWD = "hi" With Target 'one cell at a time If .Cells.Count 1 Then Exit Sub If Intersect(.Cells, Me.Range("a:a")) Is Nothing Then 'do nothing Else If .Value = "" Then 'do nothing Else Me.Unprotect Password:=myPWD .Offset(0, 1).Locked = False Me.Protect Password:=myPWD End If End If End With End Sub Huber57 wrote: I have a drop down menu titled "Reason" in Column A. Column B is protected (locked). When the "other" seletion is made, I want to be able to unlock the cell to the right so that someone can enter a reason. Can this be done with either a formula or VBA? Thanks! huber57 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamic unlock a cell (under condition) | Excel Discussion (Misc queries) | |||
Dynamic unlock a cell (under condition) | Charts and Charting in Excel | |||
how do i password protect an .xls file? how do i unlock it for automation. e.g. want to unlock and access a .xls from another .xls macro. | Excel Worksheet Functions | |||
Lock or Unlock cell references in a formula for auto fill purposes | Excel Discussion (Misc queries) | |||
Is there away to have specific cells unlock based on the entry of information in another? | New Users to Excel |