LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default UBound function does not work

I have defined two matrices InMatrix1 and InMatrix2 on a spredsheet by names.
The programme does not execute.
When I type UBound in the VBEditor, there is no prompt for the UBound word
after I press shift+spacebar.

What is the problem?
Function MatrixMult(InMatrix1 As Variant, InMatrix2 As Variant) As Variant

'generic matrix multiplication engine, pure BASIC code
Dim OutMatrix()
Dim i As Integer, k As Integer
Dim j As Integer
Dim Sum As Integer
ReDim OutMatrix(1 To UBound(InMatrix1, 1), 1 To UBound(InMatrix2, 2))

Application.Volatile 'force recalculation with spreadsheet

For i = 1 To UBound(InMatrix1, 1) 'rows of inmatrix1
For j = 1 To UBound(InMatrix2, 2) 'cols of inmatrix2
Sum = 0
For k = 1 To UBound(InMatrix1, 2)
Sum = Sum + InMatrix1(i, k) * InMatrix2(k, j)
Next
OutMatrix(i, j) = Sum
Next
Next

MatrixMult = OutMatrix

End Function


 
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
Ubound matrix Arne Hegefors Excel Programming 7 October 12th 07 06:43 PM
Why is this returning a Ubound value of zero [email protected] Excel Discussion (Misc queries) 1 September 28th 07 07:44 PM
UBound Arturo Excel Programming 5 January 26th 07 04:06 PM
Array Ubound gti_jobert[_71_] Excel Programming 6 March 27th 06 10:34 PM
Ubound & Lbound Michael168[_80_] Excel Programming 3 June 1st 04 02:00 PM


All times are GMT +1. The time now is 07:29 AM.

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"