Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
what's the problem with this ?
I added "=", quotes around "*" and "," (after rng2). Also you need to use
the Address property for rng1 and rng2 Function mySP(rng1 As Range, rng2 As Range, Optional dec As Long = 2) mySP = Evaluate("=SumProduct(Round(" & rng1.Address(, , , True) & "*" & rng2.Address(, , , True) & "," & dec & "))") End Function "dribler2" wrote: so short am i not to know the solution..never know the programming language. anyone know how to make this UDfunction work.. Function mySP(rng1 As Range, rng2 As Range, Optional dec As Long = 2) mySP = Application.Caller.Parent.Evaluate("SumProduct(Rou nd(" & rng1 * rng2, dec & "))") End Function 'syntax =mySP(A1:A100,B1:B100,1) ----SUM OF ROUNDED PRODUCT MADE OF 2 FACTOR ONLY happy holidays... driller. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
what's the problem with this ?
Apparently the "=" is not necessary. I guess most of the examples I've seen
use it, so I assumed it was needed. "JMB" wrote: I added "=", quotes around "*" and "," (after rng2). Also you need to use the Address property for rng1 and rng2 Function mySP(rng1 As Range, rng2 As Range, Optional dec As Long = 2) mySP = Evaluate("=SumProduct(Round(" & rng1.Address(, , , True) & "*" & rng2.Address(, , , True) & "," & dec & "))") End Function "dribler2" wrote: so short am i not to know the solution..never know the programming language. anyone know how to make this UDfunction work.. Function mySP(rng1 As Range, rng2 As Range, Optional dec As Long = 2) mySP = Application.Caller.Parent.Evaluate("SumProduct(Rou nd(" & rng1 * rng2, dec & "))") End Function 'syntax =mySP(A1:A100,B1:B100,1) ----SUM OF ROUNDED PRODUCT MADE OF 2 FACTOR ONLY happy holidays... driller. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
what's the problem with this ?
JMB
Here's your UDfunction, after some close/open file and auto-debug from excel, this work out for me '-------------- Function mySP2(rng1 As Range, rng2 As Range, Optional dec As Long = 2) mySP2 = Evaluate("=SumProduct(Round(" & rng1.Address(, , , True) & "*" & rng2.Address(, , , True) & "," & dec & "))") End Function '----------------- my quest is over for the function of sum of rounded products for 2 factors---- ----------------------------- i will post another thread for some more generic/productive questions---maybe for 3 to 4 more factorial products... i hope to receive more helpful reply from you more power driller |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
problem with a conditional max problem | Excel Discussion (Misc queries) | |||
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? | Excel Programming |