Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default How to Debug User Defined Functions

Hi All,
I have written a user defined function but when i go to VBE and press
F8 to step thru the code it does not work. I have gone on many
websites but most seem to show you how to create, not after... like
debug. Any help or website referral appreciated. Thks.
Rgds
KZ

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to Debug User Defined Functions

Hi Kieranz,

To step through the function's code, try inserting break
points in the function code and then insert a new instance of
the function in the worksheet.


---
Regards,
Norman



"Kieranz" wrote in message
ups.com...
Hi All,
I have written a user defined function but when i go to VBE and press
F8 to step thru the code it does not work. I have gone on many
websites but most seem to show you how to create, not after... like
debug. Any help or website referral appreciated. Thks.
Rgds
KZ



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default How to Debug User Defined Functions

select the first line in the function and press F9 to set a breakpoint

Then go to the Excel screen and cause a calculation that calls the the UDF

Charles
______________________
Decision Models
FastExcel 2.3 now available
Name Manager 4.0 now available
www.DecisionModels.com

"Kieranz" wrote in message
ups.com...
Hi All,
I have written a user defined function but when i go to VBE and press
F8 to step thru the code it does not work. I have gone on many
websites but most seem to show you how to create, not after... like
debug. Any help or website referral appreciated. Thks.
Rgds
KZ



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default How to Debug User Defined Functions

Hi Kieranz,

Just a little explain...:
you can debuging this directly by pressing F8 in this function:
Function FuncA()
FuncA = "AA"
Debug.Print FuncA
End Function

But not for this:
Function FuncB(Str As String) As String
FuncB = Str
Debug.Print FuncB
End Function

you have to use sub to call FuncB:
Sub TesFunction()
Call FuncB("BB")
End Sub


--

Regards,

Halim


"Kieranz" wrote:

Hi All,
I have written a user defined function but when i go to VBE and press
F8 to step thru the code it does not work. I have gone on many
websites but most seem to show you how to create, not after... like
debug. Any help or website referral appreciated. Thks.
Rgds
KZ


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How to Debug User Defined Functions

You cannot enter into "break-mode" for sub or function procedures that
require mandatory arguments. The trick is to set a break point in the
function and call the function from another macro.
Leo
"Kieranz" wrote in message
ups.com...
Hi All,
I have written a user defined function but when i go to VBE and press
F8 to step thru the code it does not work. I have gone on many
websites but most seem to show you how to create, not after... like
debug. Any help or website referral appreciated. Thks.
Rgds
KZ



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
User Defined Functions Walid M. Bahgat Excel Programming 3 December 6th 06 07:45 PM
User Defined Functions Barb Reinhardt Excel Programming 3 May 18th 06 04:11 PM
User Defined Functions Mike McLellan Excel Worksheet Functions 2 May 4th 06 10:56 AM
User Defined Functions - Help Text - Make it Easy for the User Andibevan[_2_] Excel Programming 4 March 17th 05 09:51 AM
excel functions and User defined functions Kanan Excel Programming 4 May 20th 04 11:21 PM


All times are GMT +1. The time now is 11:38 PM.

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

About Us

"It's about Microsoft Excel"