View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Passing a Range to a Function problem (still not working)

Colo,

Generally (meaning in my experience) people use the term UDF (User defined
function) to mean the function will be called from a spreadsheet like a
built in Excel function

=MyUDF(A1:A4)

In that case, in xl2000 and earlier, Find does not work. Dave Peterson
reports it works in xl2002 when used in a UDF called from a worksheet.

If the Function is just called from a normal VBA Sub or VBA function, then
Find works.

--
Regards,
Tom Ogilvy

Colo wrote in message
...
Hi Rocky,

Sorry my prev post was not correct.
Your UDF works as follows.


Code:
--------------------

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

Sub TestIt()
Dim X As String
X = FindIt(Range("a1:a4"))
MsgBox X
End Sub

--------------------



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