UDF Works in Debug Window but not on Sheet?

  • Thread starter Thread starter Andibevan
  • Start date Start date
A

Andibevan

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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top