Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Conditional Locked Cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shaqil - 13 Nov 2007 12:29 GMT
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
Mike H - 13 Nov 2007 12:59 GMT
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

> Dear All,
>
[quoted text clipped - 5 lines]
>
> Regards
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.