I have 2 columns. One with name, column A, (COV, COSV, ETA...) and the second with number. I have around 40000 row with 30 dirrerent name in column A. i have in a other sheet all the different name in the column A.
I want to calculate the average result, the min values and the max values for each name in column A. SO the average result of all the number in column B for each COV by exemple.
I was able to caculate the average result with the line in VBA without any problem.
WorksheetFunction.AverageIf
But i don't find any mean to made the same thing for the min and max values of column B.
The coding need to be in vba.
Any idea?
Sebastien
Here is part of the code
sub delais
Worksheets("delais_moyen").Select
lastrow = Range("C4", Range("C4").End(xlDown)).Rows.Count + 3
Worksheets(message3).Select
lastline = Range("D7", Range("D7").End(xlDown)).Rows.Count + 6
columnlettermin = Split(Cells(1, lastcol).Address, "$")(1)
columnlettermoy = Split(Cells(1, lastcol + 1).Address, "$")(1)
columnlettermax = Split(Cells(1, lastcol + 2).Address, "$")(1)
Worksheets("delais_moyen").Select
For j = 4 To lastrow
Set reponse = Sheets(message2).Range("D7:D" & lastline)
Set delais = Sheets(message2).Range("P7:P" & lastline)
reponsemin = columnlettermin & j
reponsemoy = columnlettermoy & j
reponsemax = columnlettermax & j
Range(columnlettermoy & j) = WorksheetFunction.AverageIf(reponse, Range("C" & j), delais)
next j
end sub