UDF Works in Debug Window but not on Sheet?
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 |
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 |
UDF Works in Debug Window but not on Sheet?
Thanks Bob - would never have thought of that.
|
All times are GMT +1. The time now is 02:29 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com