Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic unlock a cell (under condition) MyVi Excel Discussion (Misc queries) 5 November 9th 06 07:01 PM
Dynamic unlock a cell (under condition) MyVi Charts and Charting in Excel 0 November 7th 06 08:44 PM
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. Daniel Excel Worksheet Functions 1 June 24th 05 02:59 PM
Lock or Unlock cell references in a formula for auto fill purposes David P. Excel Discussion (Misc queries) 2 June 6th 05 11:18 PM
Is there away to have specific cells unlock based on the entry of information in another? Marc New Users to Excel 2 April 17th 05 06:09 PM


All times are GMT +1. The time now is 07:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"