Hi all,
My case looks like this
To avoid making 100 if sentences :D I am trying to create an array and combine if with array.. something like this
if x is found in array then msgbox "found it"
can anyone help me with this ??
Manny thanks in advance [/b]
My case looks like this
To avoid making 100 if sentences :D I am trying to create an array and combine if with array.. something like this
if x is found in array then msgbox "found it"
Code:
Sub test()
Dim MeatCod As Variant
MeatCod = Array("c1", "c2", "c3")
For i = 1 To 10
If Range(Cells(i, 1).Address).Value = MeatCod() Then ' puting MeatCod(1) will work
MsgBox "item found : " & MeatCod()
Else
MsgBox "Not Found"
End If
Next i
End Sub
can anyone help me with this ??
Manny thanks in advance [/b]