View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default UDF Works in Debug Window but not on Sheet?

Find doesn't work in a UDF in Excel 2000 or earlier. It would work in debug
because that is not a UDF, it is VBA.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Andibevan" wrote in message
...
I have the following UDF which works when I call it from the debug window
but not on a sheet.

Any ideas?

Public Function GetRole(sRole As String) As Long

Debug.Print "GetRole = " & GetRole

GetRole = Sheets("Settings").Range("stng_Users").Find(sRole) .Row

Debug.Print "GetRole = " & GetRole

End Function