Related:
- Vba matrix operations
- Vba case like - Guide
- Matlab concatenate matrix - Guide
- Number to words in excel formula without vba - Guide
- Vba create folder if not exist ✓ - Excel Forum
- Enable vba in excel - Guide
4 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 9, 2009 at 09:09 PM
Aug 9, 2009 at 09:09 PM
Even though I have done matric multiplication manually during my young days as a student of Mathematics it is long ago I have forgotten, If I remember correctly if you have matrix(trivial example) as below :
In excel take it as A1,B1, A2 ,B2.
A B
2 3
4 5
Now you want to make a scalar multiplication of a matrix for e.g by 6 it is
Is it
12 18
24 30
Or is it sum of these four figures(sorry I have forgotten)
I am only loudly thinking
Why not try this macro
If you want total you ca use this macro
Will this of any use? Probably not!
if it is multiplication of matrix over matrix there is a function in excel 2007 caled
MMULT
This formula is to be invoked by control+shift+enter see help under "matrix"
In excel take it as A1,B1, A2 ,B2.
A B
2 3
4 5
Now you want to make a scalar multiplication of a matrix for e.g by 6 it is
Is it
12 18
24 30
Or is it sum of these four figures(sorry I have forgotten)
I am only loudly thinking
Why not try this macro
Sub test() Dim rng As Range, c As Range Dim scalar As Double scalar = 0.9 Set rng = Range(Range("a1"), Range("a1").End(xlDown).End(xlToRight)) For Each c In rng c.Value = c * scalar Next c End Sub
If you want total you ca use this macro
Sub test1() Dim rng As Range, c As Range Dim scalar As Double, total As Double scalar = 0.9 Set rng = Range(Range("a1"), Range("a1").End(xlDown).End(xlToRight)) For Each c In rng c.Value = c * scalar Next c total = WorksheetFunction.Sum(rng) MsgBox total End Sub
Will this of any use? Probably not!
if it is multiplication of matrix over matrix there is a function in excel 2007 caled
MMULT
This formula is to be invoked by control+shift+enter see help under "matrix"