Private Sub Worksheet_SelectionChange(ByVal Target As Range) '------------------------------------------------------------------------------ Dim n As Long Dim avviso As String n = ActiveCell.Row If n < 7 Then 'avviso = MsgBox("non puoi modificare questa cella!!!", vbOKOnly + vbCritical, "ATTENZIONE!") ActiveSheet.Protect Password:="987654" Exit Sub End If If Not Intersect(Target, Range("C:C, D:D, E:E, F:F, G:G, H:H, I:I")) Is Nothing Then 'ActiveSheet.Unprotect "987654" ActiveSheet.Protect Password:="987654", DrawingObjects:=True, Contents:=True, Scenarios:=True _ , AllowFormattingCells:=True, AllowInsertingHyperlinks:=True, AllowFiltering:=True Else 'ActiveSheet.Unprotect "987654" ActiveSheet.Protect Password:="987654", DrawingObjects:=True, Contents:=True, Scenarios:=True _ , AllowFormattingCells:=False, AllowInsertingHyperlinks:=False, AllowFiltering:=True End If End Sub