
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Valore As Long
If Intersect(Target, Range("A2")) Is Nothing Then Exit Sub
Valore = Target
Select Case Valore
Case 1
Range("a1") = "X"
MsgBox ("E' uscito X")
Case 2
Range("a1") = "Y"
MsgBox ("E' uscito Y")
Case 3
Range("a1") = "Z"
MsgBox ("E' uscito Z")
Case Is > MaxNumber
Range("a1") = ""
MsgBox ("Numero Maggiore di 3")
End Select
End Sub |
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Valore As Long
If Intersect(Target, Range("b1")) Is Nothing Then Exit Sub
If Range("a1") = "x" Then
MsgBox ("Attenzione: a a a a ")
End If
If Range("a1") = "z" Then
MsgBox ("Attenzione: b b b b ")
End If
End Sub
|
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Valore As Variant
If Intersect(Target, Range("A2")) Is Nothing Then Exit Sub
Valore = Target
Select Case Valore
Case "Tizio"
Range("a1") = "X"
MsgBox ("E' uscito X")
Case "Caio"
Range("a1") = "Y"
MsgBox ("E' uscito Y")
Case "Pippo"
Range("a1") = "Z"
MsgBox ("E' uscito Z")
Case Else
Range("a1") = ""
MsgBox ("Non e' stato inserito nessun RIFERIMENTO")
End Select
End Sub
|
