Hi Neil,
First, the way Excel works is you unprotect
the cells you want to be able to change then you
protect the worksheet.
To unprotect a range of cells, select the
range, right-click,
Format Cells>Protection then unclick the 'Locked' checkbox.
To protect the worksheet,
Tools>Protection>Protect Sheet.
Now, I think the scenerio you want is...
Let's assume that Cells 'A3' and 'B3' are
unprotected in 'SHEET1'.
A3 has some data in it.
You enter a date in B3 and A3 automatically
becomes protected.
If you delete the date in B3, A3 automatically
becomes unprotected.
To do this, you must put a macro in the
'SelectionChange' section of the SHEET1.
1) Get into the Visual Basic Editor:
Tools>Macro>Visual Basic Editor
2) Get to SHEET1:
the 'Project - VBAProject' window will
be on your left. If it isn't,
VIEW>Project Explorer
Open up the 'Microsoft Excel Objects' for
your workbook
Double left-click on the 'Sheet1(Sheet1) object
3) Enter the code in SHEET1:
The right side of the window will show
'(General)' and '(Declarations)'
Drop down the box with GENERAL and
select 'WORKSHEET'.
Drop down the box with Declarations and
select 'SelectionChange'.
Anything you put in this section will happen
everytime you change your selection on SHEET1
4) The code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Len(Range("B3").Value) <> 0 Then
Range("A3").Locked = True
Else
Range("A3").Locked = False
End If
End Sub
- Every time you move your cursor to another cell,
Excel will look at B3, check to see if anything
is in B3. If there is anything in B3, Excel
will automatically protect cell A3. If there
is nothing in B3, Excel will automatically
unprotect cell A3.
HTH,
--
Gary Brown
gary_brown@ge_NOSPAM.com
If this post was helpful, please click the ''''Yes'''' button next to
''''Was this Post Helpfull to you?".
"Neil" wrote:
> I would like to protect cells once a value has been placed in another cell.
> E.G. I have a sign off date column and once a value has been entered I want
> the cells to the left to be protected. Is this Possible?
Bookmarks