View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rocky McKinley Rocky McKinley is offline
external usenet poster
 
Posts: 102
Default Passing a Range to a Function problem (still not working)

Actually it can be used if I pass the range address, but I haven't found a
way to pass the range directly.
The code below works.

Function FindIt2(Ranger As String) As String
Dim C As Range
FindIt2 = ""
Set C = Range(Ranger).Find("BALER", LookIn:=xlValues)
If Not C Is Nothing Then FindIt2 = C.Address
End Function

Sub TestIt2()
MsgBox FindIt2("a1:a4")
End Sub

--
Regards,
Rocky McKinley


"Colo " wrote in message
...
AFAIK, Find function cannot be used in UDF.
Why dont't you use match function instead?


---
Message posted from http://www.ExcelForum.com/