Q:

VBA .Find Changing Arguments Dynamically

I have a VBA function that uses the the .find method.  In my function I'd like change the LookAt: argument between xlPart or xlWhole.  I tried using a parameter variable matchvalue and passing in "xlPart" or "xlWhole".   It didn't work.  
Is there a way to change the LookAt: argument with a variable I pass into my function?
Public Function getfield(matchvalue as string)

GetRowNumber = Cells.Find(What:="Cat", After:=ActiveCell, LookIn:=xlValues, LookAt:= _

        matchvalue, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _

        , SearchFormat:=False).Activate
 End Function

A:

Not sure if the way you are splitting the lines makes you can't achieve your goal.
Try with:
Public Function getfield(matchvalue as string)

GetRowNumber = Cells.Find(What:="Cat", After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=matchvalue, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
        , SearchFormat:=False).Activate
 End Function

Reading .Find documentation, LookAt value should be Variant Type.
Read the following link.

https://msdn.microsoft.com/en-us/vba/excel-vba/articles/range-find-method-excel

