PC Review


Reply
Thread Tools Rate Thread

How to Debug User Defined Functions

 
 
Kieranz
Guest
Posts: n/a
 
      25th Apr 2007
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 With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      25th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
Charles Williams
Guest
Posts: n/a
 
      25th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
=?Utf-8?B?SGFsaW0=?=
Guest
Posts: n/a
 
      25th Apr 2007
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
>
>

 
Reply With Quote
 
LEO@KCC
Guest
Posts: n/a
 
      25th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
User defined functions that are array functions Richard Microsoft Excel Programming 1 22nd Oct 2009 06:56 PM
User Defined Functions =?Utf-8?B?TWlrZSBNY0xlbGxhbg==?= Microsoft Excel Worksheet Functions 2 4th May 2006 10:56 AM
User Defined Functions - Help Text - Make it Easy for the User Andibevan Microsoft Excel Programming 4 17th Mar 2005 09:51 AM
Show user-defined comments for user-defined functions vinesh Microsoft VB .NET 2 2nd Nov 2004 01:14 PM
excel functions and User defined functions =?Utf-8?B?S2FuYW4=?= Microsoft Excel Programming 4 20th May 2004 11:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:44 PM.