PDA

View Full Version : Block typing in column 15



marreco
03-05-2012, 04:48 AM
Hi
I remember that code was written by OSWALDO-omp001 (Brazil).

I would like to adapts it more'm not consguindo.

If in a row of column 8 is written "Apple" and in a line of column 14 is written "Reseller".

So in line with colun 15 will be allowed to enter, otherwise the colun 15 is blocked.
Private Sub Worksheet_Change(ByVal Target As Range)
'Bloquear células com certa condição
If Target.Column <> 1 Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target.Value = "Cruzeiro do Sul" Then
Me.Unprotect
Cells(Target.Row, 15).Locked = True
Me.Protect
End If
End Sub
If someone could help me, I'm grateful.

Thank you!

Bob Phillips
03-05-2012, 04:58 AM
Private Sub Worksheet_Change(ByVal Target As Range)
'Bloquear células com certa condição
If Target.Column <> 1 Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target.Value = "Cruzeiro do Sul" And _
Me.Cells(Target.Row, "H").Value = "Apple" And _
Me.Cells(Target.Row, "N").Value = "Reseller" Then

Me.Unprotect
Cells(Target.Row, 15).Locked = True
Me.Protect
End If
End Sub

marreco
03-05-2012, 05:12 AM
I'll test and will return.

For now thank you very much!

marreco
03-05-2012, 02:13 PM
hi ...
XLD, I want to thank you for your help, thank you very much!
First it worked, maybe I need to make some changes.

If I do ask your help.

I can not get solved topic, be able to do this, I am grateful.

Thank you!