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

for a test, make sure that the cells pointed at contain just numbers, no
formula, and see if their vales get passed properly

"maweilian" wrote in message
...
I have added breakpoints and checked the values. The values are zero when
referencing cells of non-zero value. However, it does not exhibit this
behavior for all the arguments, which is puzzling to me. Most of the
arguments exhibiting this behavior contain values calculated by other VBA
macros. I do not know of this is the course of the problem. I don't see
why
it would be a problem.



"Patrick Molloy" wrote:

put a break point in the function
edit/enter the formula in the spreadsheet, then when the code halts at
the
breakpoint, check the values.
also have Option Explicit at the top of your module


"maweilian" wrote in message
...
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



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
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 01:20 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"