ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MATRIX calculations with VBE (https://www.excelbanter.com/excel-programming/273654-matrix-calculations-vbe.html)

Cor Steeghs

MATRIX calculations with VBE
 
I would appreciate help in the folowing :
I want to use VBE for assigning names to a ranges of cells
on a worksheet and execute matrix calculations like
MATR_B=MINVERSE(MATR_A)
MATR_C=MMULT(MATR_A;MATR_B)
What would the code look like?
Thanks for attending and/or reply,
best regards, Cor Steeghs




Tom Ogilvy

MATRIX calculations with VBE
 
Sub demo1()
Dim varr As Variant, varr1 As Variant
varr = Evaluate("{1,2,1;3,4,-1;0,2,0}")
Range("A1:C3").Value = varr
varr1 = Evaluate("{1,2,3;4,5,6;3,2,5}")
Range("A10:C12").Value = varr
Range("A1:C3").Name = "Matr_A"
Range("A10:C12").Name = "Matr_B"
Range("D1:F3").Name = "Matr_C"
Range("D10:F12").Name = "Matr_D"
Range("Matr_C").Value = Application.MInverse(Range("Matr_A"))
Range("Matr_D").Value = Application.MMult(Range("Matr_A"), _
Range("Matr_B"))
End Sub


Regards,
Tom Ogilvy

"Cor Steeghs" wrote in message
...
I would appreciate help in the folowing :
I want to use VBE for assigning names to a ranges of cells
on a worksheet and execute matrix calculations like
MATR_B=MINVERSE(MATR_A)
MATR_C=MMULT(MATR_A;MATR_B)
What would the code look like?
Thanks for attending and/or reply,
best regards, Cor Steeghs







All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com