View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default VBA and MINVERSE

You don't have to write the values to an Excel worksheet. See the following
example code.

Sub AAA()
Dim Arr1(1 To 2, 1 To 2) As Double
Dim Arr2 As Variant
Dim R As Long
Dim C As Long

Arr1(1, 1) = 0
Arr1(1, 2) = 2
Arr1(2, 1) = 2
Arr1(2, 2) = 0
Arr2 = Application.WorksheetFunction.MInverse(Arr1)

For R = LBound(Arr2, 1) To UBound(Arr2, 1)
For C = LBound(Arr2, 2) To UBound(Arr2, 2)
Debug.Print R, C, Arr2(R, C)
Next C
Next R
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Daniel" wrote in message
...
Thank you JW,
However, I am reading 2 matrices from an external file (those matrices are
not in a workbook) and try to perform those Excel function operations in
VBA
without having to write the values on Excel.

Best, Daniel




"JW" wrote:

WorksheetFunction.MInverse
WorksheetFunction.MMult

Daniel wrote:
Is there a way to use the MINVERSE and MMULT functions without reading
from
or writing on a workbook.
Best,
Daniel