LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default arguments not working with function

Question from a Newbie Excel programmer,

I have a function that has arguments, for instance,
Private Function myfunction(arg1 as Double, arg2 as Double, etc...)
Dim anyvariable as Double
anyvariable = arg1 - arg2
.....
End Function

What is happening in the function I am working on is that when I add a
breakpoint at the line "anyvariable = arg1 - arg2" and then inspect the
values of the arguments "arg1" and "arg2", I discover that they have values
of zero. (obviously, "anyvariable" also acquires a value of zero after the
execution of that line of code.) However, in the spreadsheet the values in
the cells referred to by the arguments are non-zero! Can anyone think of a
reason why the arguments are not acquiring the values of the cells to which
they point?

The only thing I can think of is that the cells to which the arguments point
do happen to contain values that are dependent on other VBA macros and that
this could be creating a problem.

Please help,
Will
 
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
Working with arrays as arguments HB Excel Worksheet Functions 6 September 30th 09 02:48 PM
Working with 2 arguments over 4 columns (countif ??) Dubbo Excel Worksheet Functions 2 June 10th 09 05:36 AM
Disabling Function Results in the Function Arguments Window [email protected] Excel Programming 1 September 24th 08 06:12 AM
customise Insert Function/Function Arguments dialog box Niek Otten Excel Programming 1 December 14th 06 11:27 AM
Need to open the Function Arguments window from VBA for a user defined function. [email protected] Excel Programming 0 June 20th 06 03:53 PM


All times are GMT +1. The time now is 12:14 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"