So is there a "Set myrange = " somewhere before this code?
if not, then it is nothing and will not get into the Union statement.
Did you intend to test the value of Cells(lin, col) maybe?
You're doing fine once myRange gets fixed.So, how could I find max, min and avarage value?
fix myRange and you should be fine how you have it.If I save cells(i,j) in a matrix(i,j), could I use something like LabelMax.Caption = worksheetFunction.max(matrix)?
Nope, it's readily available with the Excel.Application.And, to use worksheetFunction, need I declare some library?