Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default UDF Works in Debug Window but not on Sheet?

Thanks Bob - would never have thought of that.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
customizing debug pop up window tx12345 Excel Discussion (Misc queries) 0 August 22nd 06 11:39 PM
Works fine in debug, but... DiBaco Excel Programming 5 February 24th 06 04:35 PM
Macro Works but not in Debug Step mode Bob Smedley[_2_] Excel Programming 3 January 31st 06 04:28 PM
Excel 2000 Code works except in debug mode Bob Smedley Excel Programming 0 January 24th 06 01:21 AM
Macro sends Excel file by Outlook - works in debug - not realt Prabha Excel Programming 2 December 8th 05 02:18 PM


All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"