Public
Function
SSVERWEIS( _
ByRef
Suchkriterium
As
String
, _
ByVal
Matrix
As
Range, _
ByVal
Spaltenindex
As
Variant
)
Application.Volatile
Dim
sRange
As
Range
Dim
ws
As
Worksheet
Dim
sResult
As
Variant
sResult =
""
For
Each
ws
In
Worksheets
If
ws.Index <> 1
Then
Set
sRange = Range(ws.Cells(Matrix.Row, Matrix.Column), ws.Cells(Matrix.Rows.Count, Matrix.Columns.Count))
If
IsError(Application.WorksheetFunction.VLookup(Suchkriterium, sRange, Spaltenindex,
False
)) =
False
And
_
Application.WorksheetFunction.VLookup(Suchkriterium, sRange, Spaltenindex,
False
) <>
""
Then
sResult = Application.WorksheetFunction.VLookup(Suchkriterium, sRange, Spaltenindex,
False
)
Exit
For
End
If
End
If
Next
If
IsEmpty(sResult) =
True
Then
SSVERWEIS =
""
Else
SSVERWEIS = sResult
End
If
End
Function