Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Intervallo = "A1:E10" ' <<<=== qui devi modificare l'intervallo
If Application.Intersect(Target, Range(Intervallo)) Is Nothing Then
MsgBox "La cella '" & Target.Address & "' che è stata selezionata è fuori dell'intervallo '" & Intervallo & "'" & Chr(10) & "che è possibile selezionare."
Exit Sub
End If
If Target.Value = "" Then
If Target.Offset(-1, 0).Value = "" Then
MsgBox "La cella '" & Target.Address & "' e la cella soprastante sono vuote"
Else
Target.Value = Target.Offset(-1, 0).Value
End If
Else
MsgBox "La cella '" & Target.Address & "' che è stata selezionata non è vuota"
End If
End Sub
|