VBA Formel

Weil ich es immer wieder brauche…
Public Function STRINGINRANGEOR(rngSearch As Range, ParamArray parms() As Variant) As Boolean
Dim x As Long
Dim y As Long
Dim i As Long
Dim bResult As Boolean
bResult = False

For x = 1 To rngSearch.Columns.Count
For y = 1 To rngSearch.Rows.Count
For i = LBound(parms) To UBound(parms)
If InStr(1, rngSearch.Cells(y, x).Value, parms(i), vbTextCompare) > 0 Then
bResult = True
GoTo Result
End If
Next i
Next y
Next x

Result:
STRINGINRANGEOR = bResult

End Function

1 Kommentar

Kommentare sind geschlossen.