View Single Post
 
Old 04-06-2012, 06:21 PM
caholmes caholmes is offline Windows Vista Office 2007
Advanced Beginner
 
Join Date: Dec 2008
Location: Sydney, Australia
Posts: 54
caholmes is on a distinguished road
Default

Hi Tinfanide,

unfortunately you can't have your cake and eat it too. The only way to protect data on a sheet using the excel tools is to protect the sheet. This causes the locked property to be enforced for each cell. You could possibly protect and unprotect the sheet if it meets a condition using the Worksheet_SelectionChange event. It could look something like this.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If IsEmpty(Target) Then
ActiveSheet.Unprotect Password:="dog"
Else
ActiveSheet.Protect Password:="dog", DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
End Sub

Alternatively you could password protect a range (Allow uses to edit ranges) located on the Review Tab however you would still need to protect and unprotect the data based on a condition. This method may just give you a bit more control over the data.

I hope this helps!
Reply With Quote