haarish4life
02-23-2006, 07:26 AM
Hi there !
Just wanted to ask you a quick question. I've a VBA code which changes accordingt an input parameter i which changes every time depending where it is in the loop.
say for example the return value is return(j) which changes for each value of j.
I want a code which will return the value of the sum of all the return(j) for j=1 to n
I have tried using
Sub g()
for j =1 to n
Return (j) = .......someinputformla which is dependent on (j)
g=worksheetfunction.sum(return(j))
Cells(1,1) = g
Next j
End sub
But it does not work....basically,i just wanna know how to sum the return (j)
Thanks for yourtime
Regards
Haarish
Just wanted to ask you a quick question. I've a VBA code which changes accordingt an input parameter i which changes every time depending where it is in the loop.
say for example the return value is return(j) which changes for each value of j.
I want a code which will return the value of the sum of all the return(j) for j=1 to n
I have tried using
Sub g()
for j =1 to n
Return (j) = .......someinputformla which is dependent on (j)
g=worksheetfunction.sum(return(j))
Cells(1,1) = g
Next j
End sub
But it does not work....basically,i just wanna know how to sum the return (j)
Thanks for yourtime
Regards
Haarish