Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Excel locking cell based on value in another cell

Hi all

My code locks another cell based on value in another cell. I got it working
just for 1 row but i would like to do it for the subsequent rows (E10, E11,
E12, E13...)... any help??



Private Sub Worksheet_Change(ByVal Target As Range)

If [E9] = "A" Then
ActiveSheet.Unprotect ("")
ActiveSheet.Range("G9:K9").Locked = True
ActiveSheet.Protect ("")
Else
ActiveSheet.Unprotect ("")
ActiveSheet.Range("G9:K9").Locked = False
ActiveSheet.Protect ("")
End If

End Sub



Thanks in advance



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Excel locking cell based on value in another cell

Check one of your other threads.

Kelson wrote:

Hi all

My code locks another cell based on value in another cell. I got it working
just for 1 row but i would like to do it for the subsequent rows (E10, E11,
E12, E13...)... any help??

Private Sub Worksheet_Change(ByVal Target As Range)

If [E9] = "A" Then
ActiveSheet.Unprotect ("")
ActiveSheet.Range("G9:K9").Locked = True
ActiveSheet.Protect ("")
Else
ActiveSheet.Unprotect ("")
ActiveSheet.Range("G9:K9").Locked = False
ActiveSheet.Protect ("")
End If

End Sub

Thanks in advance


--

Dave Peterson
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
Locking a cell based on a cells content The Rook[_2_] Excel Discussion (Misc queries) 1 June 2nd 10 08:41 PM
Cell locking based on domain user Wolter Excel Worksheet Functions 6 June 4th 09 06:42 AM
Locking/Unlocking based on another cell value Iriemon Excel Worksheet Functions 0 March 27th 08 02:47 PM
Excel Locking cells based on value in another cell Kelson Excel Discussion (Misc queries) 2 October 10th 07 10:49 PM
Locking other cells based on values in a cell. Mario[_6_] Excel Programming 1 January 11th 04 07:41 AM


All times are GMT +1. The time now is 05:39 PM.

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

About Us

"It's about Microsoft Excel"