Option
Explicit
Public
Sub
TestSetup()
With
Range(
"B2"
)
.Interior.Color = rgbYellow
Call
.Validation.Add(xlValidateList, Formula1:=
"Apfel,Banane,Birne,Kirsche"
)
End
With
End
Sub
Private
Sub
Worksheet_Change(
ByVal
Target
As
Range)
If
Target.Cells(1).Address =
"$B$2"
Then
Select
Case
Target.Cells(1).Value
Case
"Apfel"
Call
MsgBox(
"Es gibt rote, grüne und auch gelbe Äpfel."
, vbInformation)
Case
"Banane"
Call
MsgBox(
"Eine reife Banane ist gelb-braun."
, vbInformation)
Case
"Birne"
Call
MsgBox(
"Es gibt grüne und auch gelbe-grüne Birnen."
, vbInformation)
Case
"Kirsche"
Call
MsgBox(
"Klein, rund, rot und lecker."
, vbInformation)
Case
Else
Call
MsgBox(
"Auswahl ist nicht gültig."
, vbExclamation)
End
Select
End
If
End
Sub