marlonsaveri
Board Regular
- Joined
- Jan 28, 2011
- Messages
- 68
I use this code to discover, but it's not running:
col: column
lin: line / row
numcol: number of columns
So, how could I find max, min and avarage value?
If I save cells(i,j) in a matrix(i,j), could I use something like LabelMax.Caption = worksheetFunction.max(matrix)? And, to use worksheetFunction, need I declare some library?
Thanks.
Code:
For lin = foundcell.Row To foundcell.MergeArea(foundcell.MergeArea.count).Row
For col = 4 To numcol - 1
Cells(lin, col).Interior.Color = RGB(212, 200, 200)
If Not myrange Is Nothing Then
Set myrange = Union(myrange, Cells(lin, col))
End If
Next col
Next lin
LabelMax.Caption = WorksheetFunction.max(myrange)
LabelMin.Caption = WorksheetFunction.min(myrange)
LabelAverage.Caption = WorksheetFunction.Average(myrange)
lin: line / row
numcol: number of columns
So, how could I find max, min and avarage value?
If I save cells(i,j) in a matrix(i,j), could I use something like LabelMax.Caption = worksheetFunction.max(matrix)? And, to use worksheetFunction, need I declare some library?
Thanks.