dodo mi dovresti dire dove devo mettere il tuo codice perchè non so come va inserito.
perchè ho provato ad inserire un nuovo modulo e in this workbook mettendo il codice cosi modificato
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If ActiveSheet.Name <> "RIEP" And ActiveSheet.Name <> "codici servizi" Then
Dim R As Long
R = Target.Row
If Not Intersect(Target, [I14:I60]) Is Nothing Then
If Range("I" & R) = 2 Or Range("I" & R) = 3 Or Range("I" & R) = 4 Then
MsgBox "qui va messo solo codice presenza"
Application.EnableEvents = False
Target.ClearContents
Application.EnableEvents = True
End If
End If
' questo codice ti da un messaggio di errore se per sbaglio metti riposo lo stesso giorno che hai lavorato
If Intersect(Target, Uni0n(Range("C14:C60"), Range("J14:J60"))) Is Nothing Then Exit Sub
Select Case Target.Column
Case 3
If Range("J" & R) <> "" Then
MsgBox "Non puoi scrivere in questa cella se colonna J non è vuota"
Application.EnableEvents = False
Target.ClearContents
Application.EnableEvents = True
Exit Sub
End If
Case 10
If Range("C" & R) <> "" Then
MsgBox "Non puoi scrivere in questa cella se colonna C non è vuota"
Application.EnableEvents = False
Target.ClearContents
Application.EnableEvents = True
Exit Sub
End If
End Select
End Sub
ma non funziona
grazie
[Modificato da trittico69 23/12/2017 14:48]
excel 2003