Lock only a few cells on a worksheet
Closed
ugn10
Posts
44
Registration date
Saturday 27 October 2012
Status
Member
Last seen
4 March 2014
-
16 Mar 2013 à 18:32
sgmpatnaik Posts 52 Registration date Tuesday 2 April 2013 Status Member Last seen 27 November 2013 - 3 Apr 2013 à 04:30
sgmpatnaik Posts 52 Registration date Tuesday 2 April 2013 Status Member Last seen 27 November 2013 - 3 Apr 2013 à 04:30
Related:
- Lock only a few cells on a worksheet
- Caps lock reversed - Guide
- Lock samsung tablet - Guide
- Tentacle lock - Download - Adult games
- Free fire id lock - Facebook Forum
- Input phone lock code - Phones, PDA & GPS Forum
2 responses
Zohaib R
Posts
2368
Registration date
Sunday 23 September 2012
Status
Member
Last seen
13 December 2018
69
18 Mar 2013 à 16:49
18 Mar 2013 à 16:49
Hi,
Steps mentioned in the link that you provided viz. "Locking" or "Hiding" specific cells, will not work unless the Worksheet is password protected. I use Microsoft Excel 2010, to password protect a worksheet we need to click on "Review" tab in the top ribbon and then select "Protect Sheet" and then choose a password.
Do reply with results.
Steps mentioned in the link that you provided viz. "Locking" or "Hiding" specific cells, will not work unless the Worksheet is password protected. I use Microsoft Excel 2010, to password protect a worksheet we need to click on "Review" tab in the top ribbon and then select "Protect Sheet" and then choose a password.
Do reply with results.
sgmpatnaik
Posts
52
Registration date
Tuesday 2 April 2013
Status
Member
Last seen
27 November 2013
45
3 Apr 2013 à 04:30
3 Apr 2013 à 04:30
Hi,
I am not sure what r u going to achieve if you want to lock the cells which is mention in the d1,e9 etc
Please try the below code, if any problem please inform us
'
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' constants
' declarations
' start
Me.Unprotect
Application.EnableEvents = False
' process
[A1:d20].Locked = True
If [A1].Value = "Un Lock" Then
[A5:A20].Locked = False
End If
If [B1].Value = "Un Lock" Then
[B5:B20].Locked = False
End If
If [C1].Value = "Un Lock" Then
[C5:C20].Locked = False
End If
If [D1].Value = "Un Lock" Then
[D5:D20].Locked = False
End If
' end
Application.EnableEvents = True
Me.Protect
End Sub
'
Thanks
Patnaik
I am not sure what r u going to achieve if you want to lock the cells which is mention in the d1,e9 etc
Please try the below code, if any problem please inform us
'
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' constants
' declarations
' start
Me.Unprotect
Application.EnableEvents = False
' process
[A1:d20].Locked = True
If [A1].Value = "Un Lock" Then
[A5:A20].Locked = False
End If
If [B1].Value = "Un Lock" Then
[B5:B20].Locked = False
End If
If [C1].Value = "Un Lock" Then
[C5:C20].Locked = False
End If
If [D1].Value = "Un Lock" Then
[D5:D20].Locked = False
End If
' end
Application.EnableEvents = True
Me.Protect
End Sub
'
Thanks
Patnaik