Try this. If your sheet is protected, uncomment the two green lines and change the password to suit.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Target.Column = 7 Then
'Me.Unprotect Password:="Secret"
If Target.Value = "Ricevuta" Then
Me.Cells(Target.Row, 8).Locked = True
Me.Cells(Target.Row, 9).Locked = True
ElseIf Target.Value = "Fattura" Then
Me.Cells(Target.Row, 8).Locked = False
Me.Cells(Target.Row, 9).Locked = False
End If
'Me.Protect Password:="Secret"
End If
End If
End Sub
Bookmarks