vishwakarma

01-18-2011, 11:45 PM

Hi guys,

I have a UDF function which returns multiple entries:-

Function VlookupAll(rLookupVal, rTable As Range, lCol As Long)

Dim rCell As Range, Result

VlookupAll = CVErr(xlErrNA)

For Each rCell In rTable

If rCell = rLookupVal Then

Result = Result & "," & rCell.Offset(, lCol - 1)

End If

Next rCell

If Result <> "" Then

Result = Right(Result, Len(Result) - 1)

VlookupAll = Result

End If

End Function

But there is problem,it is taking too much time to process the result.

Is it possible to make it faster ??

My excel file gets stuck/Not Responding when it is calculating...

Thanks,

I have a UDF function which returns multiple entries:-

Function VlookupAll(rLookupVal, rTable As Range, lCol As Long)

Dim rCell As Range, Result

VlookupAll = CVErr(xlErrNA)

For Each rCell In rTable

If rCell = rLookupVal Then

Result = Result & "," & rCell.Offset(, lCol - 1)

End If

Next rCell

If Result <> "" Then

Result = Right(Result, Len(Result) - 1)

VlookupAll = Result

End If

End Function

But there is problem,it is taking too much time to process the result.

Is it possible to make it faster ??

My excel file gets stuck/Not Responding when it is calculating...

Thanks,