Ralph,
The following code goes in the code module for the scheduling sheet.
You access that by right-clicking the sheet tab and selecting "View Code".
The code prevents entry into any cell on the sheet. However, when any cell
in Column B is double-clicked then, if the cell is empty, an entry can be made.
You should change "B" to the column with the students name.
All three instances of "Password" should be replaced with your choice of password.
The code is dynamic, so you will not be able to make changes to the sheet
unless you disable the code.
To protect the code: while in the code module, go to...
Tools | VBAProjectProperties | Protection (tab) ...
Enter a password and checkmark "Lock project for viewing".
Use a different password from that used in the code.
Regards,
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
'-------------
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Me.Columns("B"), Target) Is Nothing Then
If Len(Target.Value) Then
Cancel = True
Else
Me.Unprotect "Password"
Target.Locked = False
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Unprotect "Password"
Target.Locked = True
Me.Protect "Password"
End Sub
'------------------
"Ralph Malph"
wrote in message...
I have a spread sheet that someone else wrote for doing some simple
scheduling. It has cells that the user fills in with their name to place
themselves on the schedule. I need to fix it so that once the cell has a name
in it, it can not be removed/changed without a password. I have done a bit of
VB and VBA programming, but have no idea how to do it or gain access to the
"Code" side of a cell in Excel to do a simple check for existing data and if
not blank require a password to change. Once this security is implemented I
would also need to know how to lockdown the spread sheet so that the only
thing that a user can do without a password is put their name in a blank
"time slot" cell. I don't want any one going in to design mode and finding to
password etc. This is used by students and right now there are some who will
erase someones name and then put theirs in place of it so that they can get
some of the coveted spots on the calendar.
Anyone with any suggestions for how to do this or a good quick free online
tutorial that will show how to do it will be forever in my debt. Thanks for
all your help.
Ralph Malph