Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Protect or Unprotect Cell dependent on different cell

I am trying to find a way of automatically protecting a cell if an adjacent
cell has a specific value whilst if that cell has a different value the cell
would be unprotected.

For example if I am aiming to have a column with values in that will be
entered but if a field next to it has a 1 in the value field will then be
locked. But if the 1 is changed to a 0 the value field could then be edited.

Many Thanks for any help.

David

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default Protect or Unprotect Cell dependent on different cell

You could do this with a worksheet_change event to make it fully
automatic.Unlock ccell f1protect the sheetright click sheet tabview
codeinsert this. Now when you change f1 it will lock/unlock g1

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < Range("f1").Address Then Exit Sub
With ActiveSheet
..Unprotect
If Target = 1 Then
.Range("g1").Locked = True
Else
.Range("g1").Locked = False
End If
..Protect
End With
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"David Bruce" <David
wrote in message
...
I am trying to find a way of automatically protecting a cell if an adjacent
cell has a specific value whilst if that cell has a different value the
cell
would be unprotected.

For example if I am aiming to have a column with values in that will be
entered but if a field next to it has a 1 in the value field will then be
locked. But if the 1 is changed to a 0 the value field could then be
edited.

Many Thanks for any help.

David


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Protect or Unprotect Cell dependent on different cell

My preference for that is to use data validation with a custom validation.
Then you can use a formula to check the values of other cells to either allow
or disallow entry. Fot ease of use to your end users you may want to add a
conditional format to indicate when the cell is available to be edited...

Data | Validation | Custom | Add a formula and uncheck Ignore Blanks
--
HTH...

Jim Thomlinson


"David Bruce" wrote:

I am trying to find a way of automatically protecting a cell if an adjacent
cell has a specific value whilst if that cell has a different value the cell
would be unprotected.

For example if I am aiming to have a column with values in that will be
entered but if a field next to it has a 1 in the value field will then be
locked. But if the 1 is changed to a 0 the value field could then be edited.

Many Thanks for any help.

David

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
how blank data validation cell after changing dependent cell? Ian Elliott Excel Discussion (Misc queries) 5 August 16th 09 02:42 AM
protect unprotect toggle VBA Wanna Learn Excel Discussion (Misc queries) 6 February 8th 09 08:21 PM
Protect, unprotect Pyrite Excel Discussion (Misc queries) 0 August 15th 08 03:18 PM
Protect/unprotect all sheets at once? wx4usa New Users to Excel 4 July 22nd 08 12:08 AM
Jumping reference cell in dependent cell formula jpeterspro Excel Worksheet Functions 1 November 28th 07 10:34 AM


All times are GMT +1. The time now is 01:28 AM.

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"