ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Cell Protection (https://www.excelbanter.com/excel-programming/343459-conditional-cell-protection.html)

Joe Delaney

Conditional Cell Protection
 
I need to be able to prevent any other information being entered in a
column once one cell has been entered.

For example if someone inputs information into cell A1, I do not want
anyone else to be able to enter anything anywhere else in Column A or
for there to be a warning before they do so.

Is this possible?


Gary Keramidas

Conditional Cell Protection
 
see if you can adapt this. if any cell in a4:a20 = x, it will lock that
cells in that row from b to g.

right click the sheet name, choose view code and paste it there


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Not Intersect(Target, Range("A4:A20")) Is Nothing Then
If UCase(Target.Value) = "X" Then
Range(Cells(Target.Row, "B"), Cells(Target.Row, "G")) _
.Locked = True
ElseIf Target.Value = "" Then
Range(Cells(Target.Row, "D"), Cells(Target.Row, "G")) _
.Locked = False
End If
End If
End If
End Sub


--


Gary


"Joe Delaney" wrote in message
ups.com...
I need to be able to prevent any other information being entered in a
column once one cell has been entered.

For example if someone inputs information into cell A1, I do not want
anyone else to be able to enter anything anywhere else in Column A or
for there to be a warning before they do so.

Is this possible?





All times are GMT +1. The time now is 09:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com