# UDF with vLookup or a UDF with Filtering Function question



## julhs (Dec 31, 2022)

Just want to get a quick sense as to which of these two methods is the better one to pursue?
To this person who muddles their way through Excel; in a very loose sense vLookup and Filtering are basically doing the same thing?

Just asking because the UDF I will need to come up with for use with either is going to be an extreme challenge for me.
Trying to avoid spending hours on one option when the other would have been the better route!

 Any advice greatly received


----------



## JEC (Dec 31, 2022)

For a Vlookup you don't need a UDF. Your goal is not very clear to me. If you could explain something with a sample table (use XL2BB tool to upload samples), you might get better answers.


----------



## julhs (Dec 31, 2022)

Thanks for reply.

Yes of course your right, re UDF with Vlookup but I suppose same goes for UDF with Filter Function?
I suppose the question is really a general one as to which method, Vlookup or Filter Function has the broader scope/functionality for filtering/extracting data.


----------



## JEC (Dec 31, 2022)

Do you mean the Filter function in VBA or the Filter function in Excel(for which you need office 365).
Vlookup probably works better in your scenario.

The Filter function in VBA more complex. You need a workaround for exact matches, which is not easy to understand if you are a beginner in VBA.


----------



## JEC (Dec 31, 2022)

To show you. The string "Find" has two matches, using Filter.
As you can see, it is also case sensitive in default.


```
Sub jecc()
 Dim ar
 ar = Array("Find me", "Find", "You can't find me")
 MsgBox Join(Filter(ar, "Find"), vbLf)
End Sub
```


----------



## julhs (Dec 31, 2022)

Sorry I’m lagging behind!
I stress, this post is a general/outline/advice one before I started a new one regarding a previous thread that required a new thread due to a change in method/goals. I hope that makes sense?

Link to Copy “Comments” using VBA, with a twist.
Excel Filter Function does 99% of what I want BUT; I need to “Copy & Paste” the filtered results to another range on the Activesheet hence the need for UDF Filter Function??


----------



## julhs (Dec 31, 2022)

Excel 2010 does have a Filter Function but not maybe as user freindly or provide same range of function


----------

