I’m trying to use a formula (FINDSERIES) and I’m getting a #NAME? error. I have the following setup in VB. I’ve used the same function successfully in other excel files, but I’m failing here. What am I doing wrong this time?
Public Function FindSeries(TRange As Range, MatchWith As String)
For Each cell In TRange
If cell.Value = MatchWith Then
x = x & cell.Offset(0, 1).Value & “, ”
End If
Next cell
FindSeries = Left(x, (Len(x) – 2))
End Function