Data Entry and Protection

  • Thread starter Thread starter tiptoe
  • Start date Start date
T

tiptoe

I want to create a spreadsheet where person A enters details in the
spreadsheet and saves sheet. Person B comes along and opens the sheet
and can enter details, but must not be able to alter any details
entered by A.

Can any one point me in the right direction?

Thanks,
Tiptoe
 
Tools->Protection->allow users to edit ranges. this allows you to set custom
access to different areas of the sheet. Not sure if that is exactly what your
looking for, but it sounds like what you want.
 
Tools->Protection->allow users to edit ranges. this allows you to set custom
access to different areas of the sheet. Not sure if that is exactly what your
looking for, but it sounds like what you want.

Not sure if that will work as the new entry will be immediately below
the previous and the person making the entry is not predictable.

Any other ideas?

tiptoe
 
Maybe something like this...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheet1.Unprotect "tiptoe"
Dim rgCell As Range
For Each rgCell In Range("B2:C11")
If rgCell.Value = "" Then
rgCell.Locked = False
Else: rgCell.Locked = True
End If
Next
Sheet1.Protect "tiptoe"
End Sub

When the workbook is saved each cell in the range of cells where data
is to be entered by all the different other users (Sheet1!B2:C11 in
the sample code) is locked if not blank and unlocked if blank. The
sheet is protected with the password "tiptoe"

The code has to be pasted into the ThisWorkbook code module.

Ken Johnson
 
Maybe something like this...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheet1.Unprotect "tiptoe"
Dim rgCell As Range
For Each rgCell In Range("B2:C11")
If rgCell.Value = "" Then
rgCell.Locked = False
Else: rgCell.Locked = True
End If
Next
Sheet1.Protect "tiptoe"
End Sub

When the workbook is saved each cell in the range of cells where data
is to be entered by all the different other users (Sheet1!B2:C11 in
the sample code) is locked if not blank and unlocked if blank. The
sheet is protected with the password "tiptoe"

The code has to be pasted into the ThisWorkbook code module.

Ken Johnson

Ken,
Thanks, looking good.

Regards,
tiptoe
 
You're welcome tiptoe.
Thanks for the feedback and the great rating.

Ken Johnson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top