Run-time error '1004' . Please help. Urgent

B

BEETAL

Unable to get the MMult property of the WorksheetFunction class

What should I do? This is what I get when I run the VBA code. The matrices
are correct by definition and declarartion etc
--
beetal

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/communitie...de9006a&dg=microsoft.public.excel.programming
 
P

Per Jessen

Hi Beetal

I guess that the number of columns in array1 is different from the number of
rows array2, as they need to be equal to use this function.

Regards,
Per
 
B

BEETAL

Option explicit
Option Base 1
Sub mmatrixmulttest()
Dim q, ran,t as double
Dim Randommat () as variant
Dim CMAT() as variant
Redim CMAT(X,X)
Redim Randommat(1,X)
For q = 1 To X
ran = Application.WorksheetFunction.NormSInv(Rnd())
Randommat(1, q) = ran * t
Next q
cmat = APPLICATION.RANGE("cmat")
Dim Rmattranspose() As Variant
ReDim Rmattranspose(X, 1)
Rmattranspose = Application.WorksheetFunction.Transpose(Rmat)
WITH APPLICATION
MATRIXINTER = .MMult(Rmattranspose,cmat)
end with
End Sub


THE VBE does not show MMult application funtion.
 
B

BEETAL

:

Option explicit
Option Base 1
Sub mmatrixmulttest()
Dim q, ran, t, X As Double
Dim Randommat() As Variant
Dim CMAT() As Variant
CMAT = Application.Range("VC")
X = UBound(CMAT, 1)
Dim matrixinter() As Variant
Dim matrixinter2() As Variant
ReDim matrixinter(X, X)
ReDim matrixinter2(X, X)
ReDim CMAT(X, X)
ReDim Randommat(1, X)
For q = 1 To X
ran = Application.WorksheetFunction.NormSInv(Rnd())
Randommat(1, q) = ran * t
Next q
Dim Rmattranspose() As Variant
ReDim Rmattranspose(X, 1)
Rmattranspose = Application.WorksheetFunction.Transpose(Randommat)
With Application
matrixinter = .MMULT(Rmattranspose, CMAT)
matrixinter2 = .MMULT(CMAT, CMAT)' this multiplication also does not
'work.Typemismatch is the error
End With
End Sub


THE VBE does not show MMult application funtion.

beetal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top