View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Conditional Locked Cells

Hi,

Firstly select A1 - A100 and then:-
Format|cells|Protection and remove the Locked checkmark.
Then right click the sheet tab, view code and paste this in:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then ' Change to
suit
Application.EnableEvents = False
ActiveSheet.Unprotect Password:="mypass"
Target.Locked = True
ActiveSheet.Protect Password:="mypass"
Application.EnableEvents = True
End If
End Sub

Changing a cell in the range A1 to A100 causes it to become locked. You can
change this range to suit

Mike

"shaqil" wrote:

Dear All,

I have a sheet in which 3 columns are for data feeding and i need that
if any body feed any item in non blank cells then it will be locked
and he couldn't alter if he fed the data once.

await for early and positive response.

Regards