Cell Lockouts
I have just reopened a workbook that I built 2 years ago with much help from
Bill Manville. In the time that has passed, I have not had one opportunity
to use Visual Basic, and so what I learned, I have forgotten.
What I am trying to do is to revise the way I am locking out some data cells
based on the answer to a question in a leading cell. Currently in my
workbook, I ask a yes/no question, and if the answer is "yes", then the
following cell remains unlocked so that data can be entered. If the answer
is "no", the following cell locks so that when the User hits the tab key, he
is taken to the next section. This is all done with the following language:
ElseIf Not Intersect(Target, Me.Range("SCBCDYesNo")) Is Nothing Then
If Me.Range("SCBCDYesNo") = "NO" Then
Me.Range("SCBCDEff").Locked = True
Else
Me.Range("SCBCDEff").Locked = False
End If
The problem I have found is that if the lead cell (SCBCDYesNo) is left blank,
the SCBCDEff cell remains unlocked, and data can be entered. I would like it
to be locked in this case as well, only unlocking if the answer is "yes".
I've tried simple rewrites that have not worked, so I'm open for some
suggestions.
Thanks, Chuck Rollins
|