Excel-97 (SR-2)

I would like to write a macro (CrossProduct) to achieve the following

[G15:Fourier Coefficient] = CrossProduct( A20:A2067, G20:G2067) /G14

presumably to look something like

public function CrossProduct( range1, range2)

dim iCos, result

result = 0

for iCos = 0: Len( range1)-1

result += range1[ iCos] *range2[ iCos]

end for

CrossProduct = result

End Function

BTW, I am doing something equivalent to this (well not precisely

correct since I have not corrected with the Sqrt( N/(N-1))^2 factor

cleaning up after STDEV introduces), but it is slow and tedious:

[G15:Fourier Coefficient] = Correl( A20:A2067, G20:G2067)

* Stdev(A20:A2067) *Stdev(G20:G2067)

/G14

but I need the method for accessing a cell range for plenty of other

applications.

I have no idea how to find a thread to this topic in the online help,

hence the post.

TIA,

Fred.