Gruppe
Allgemein
Problem
Wie kann ich prüfen, ob ein Zellwert in einer Matrix enthalten ist?
StandardModule: basMain
Sub Vergleich()
Dim arr As Variant, var As Variant
arr = Array(52, 54, 58, 72, 30)
var = Application.Match(Range("A1").Value, arr, 0)
If IsError(var) Then
MsgBox "Wert ist nicht in der Matrix enthalten!"
Else
MsgBox "Wert ist in der Matrix enthalten!"
End If
End Sub