This version will return an array. If you are calling from a sheet, you need to select the range of cells where you want the value returned and enter =FindSeries(..) as an array formula, using Ctrl-Shift-Enter (Cmd+Return for Mac) to enter the formula.
Public Function FindSeries(TRange As Range, MatchWith As String)
Dim retArray as Variant
For Each cell In TRange
If cell.Value = MatchWith Then
x = x & cell.Offset(0, 1).Value & ", "
End If
Next cell
retArray = Split(Left(x, (Len(x) - 2)),", ")
FindSeries = retArray
End Function
Bookmarks