Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello! I am curious to learn about something called an Argument List. I
learned this term just recently. I hope I am using the term correctly. I am talking about the value Fee at this site: http://articles.techrepublic.com.com...1-5300300.html I guess the argument list receives arguments passed to the procedure. Is that right? Can someone please educate me as to how this works, and maybe post a simple example? Or, if someone knows of a good site that explains how this technique works, please copy/paste the link here. Also, I am trying to understand how Excel knows in which order to execute each argument. I found the following code (below) online and am trying to get it to work, but it doesnt seem to be cooperating. I named two arrays and called the function, but I just get a resule of #VALUE! My two ranges are A1:A4, named loss_amount and B1:B4, named probability. Then in D! I have: =expval(A1:A4,B1:B4). Function ExpVal(probability, loss_amount) 'calcs expected value for arrays named probability and loss_amount If Application.Sum(probability) < 1 Or _ Application.Count(loss_amount) < Application.Count(probability) Then ExpVal = -1 Exit Function ElseIf probability.Rows.Count < loss_amount.Rows.Count Then loss_amount = Application.Transpose(loss_amount) End If ExpVal = Application.SumProduct(loss_amount, probability) End Function Is probability listed as the first argument because it is tested first in the IfThen logic sequence above? Any help would be greatly appreciated. Regards, Ryan--- -- RyGuy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passed Arguments to a UDF | Excel Worksheet Functions | |||
Invalid procedure call or argument error | Excel Programming | |||
Invalid Procedure call or argument | Excel Programming | |||
Passing a Function name as a procedure argument | Excel Programming | |||
Passing Userform as an argument to a procedure | Excel Programming |