Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Forgot to say that I was working in Excel 2003... Anyone?
chuckrollins wrote: 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 -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200903/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Programming | |||
NEED VBA TO SELECT A CELL; NOTE THE CELL VALUE;COPYADJ CELL;FIND CELL VALUE IN A RANGE AND SO ON | Excel Programming | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) |