Conditional Cell Protection

J

Joe Delaney

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?
 
B

Bob Phillips

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ans As Long
On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If Application.CountA(.EntireColumn) > 0 Then
ans = MsgBox("Data already present" & vbNewLine & _
"ARe you sre?", vbYesNo)
If ans <> vbYes Then
.Value = ""
End If
End If
End With

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top