ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to calculate a Max / min in a matrix (https://www.excelbanter.com/excel-programming/411185-how-calculate-max-min-matrix.html)

Olivier B

How to calculate a Max / min in a matrix
 
Hi !

I must do calculations on matrix in vba code.
for the moment, i use loops (for i=x to y ... next i) to do sums and other
calcultations but I'm pretty sure it have some function to simply do basic
math functions on those matric in vba code (sum, prod, min/max, average).

This is a Matrix sample :
1 5 10
1 6 11
0 7 15

In vba code I write :
Dim Matrix1 as double
Redim Matrix1(3, 3)

How to simply calculate a min / max function in one given line or column ?


--
olivier

merjet

How to calculate a Max / min in a matrix
 
Answer = Application.WorksheetFunction.Large(Matrix1, 1)

Hth,
Merjet


All times are GMT +1. The time now is 01:27 PM.

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