Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Conditionally lock a Cell

I have a holiday sheet where a number of the cells are locked but some can be
accessed to put in holiday requests.

The person inputs their holiday request in cell C15, the manager then
unlocks the worksheet and puts "Yes" into cell G15.

Is there anything I can do to make this "Yes" entry automatically tick the
lock cell option in C15 - so that the request cannot be retrospectively
changed once the approval has been made?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,355
Default Conditionally lock a Cell

The only way I know of to do this is with a worksheet_change event.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Count < 1 Then Exit Sub
If Not Intersect(Target, Range("$G:$G")) Is Nothing Then
If LCase(Target.Value) = "yes" Then
With Target.Offset(0, -4)
.Locked = True
End With
End If
End Sub


You can read more about worksheet events here.

http://www.mvps.org/dmcritchie/excel/event.htm

"Dave Shanky" wrote:

I have a holiday sheet where a number of the cells are locked but some can be
accessed to put in holiday requests.

The person inputs their holiday request in cell C15, the manager then
unlocks the worksheet and puts "Yes" into cell G15.

Is there anything I can do to make this "Yes" entry automatically tick the
lock cell option in C15 - so that the request cannot be retrospectively
changed once the approval has been made?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 2 January 21st 07 10:59 PM
Lock cell control conditionally? Carl R. Excel Discussion (Misc queries) 0 January 18th 07 05:52 PM
How can you lock cell conditionally SAM SEBAIHI Excel Discussion (Misc queries) 5 December 4th 06 06:39 AM
conditionally lock cells? GoBobbyGo Excel Discussion (Misc queries) 1 March 22nd 06 06:59 PM
Lock and unlock cells conditionally depending on input in another Frustrated Excel Worksheet Functions 1 November 11th 05 03:36 PM


All times are GMT +1. The time now is 06:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"