How do you write a macro that specifices the largest number result in range of values
B Beth0202 Sep 17, 2004 #1 How do you write a macro that specifices the largest number result in range of values
J JulieD Sep 17, 2004 #2 Hi Beth do you mean that you want to return the Maximum of a range with a formula use =MAX(A1:A100) with vba use max_value = application.worksheetfunction.max(Range("A1:A100")) where range A1:A100 are your numbers Cheers JulieD
Hi Beth do you mean that you want to return the Maximum of a range with a formula use =MAX(A1:A100) with vba use max_value = application.worksheetfunction.max(Range("A1:A100")) where range A1:A100 are your numbers Cheers JulieD
E eluehmann Sep 17, 2004 #3 you can do the using the =max(range in here) function If this is no what you are looking for you will have to post a more detailed example
you can do the using the =max(range in here) function If this is no what you are looking for you will have to post a more detailed example
D Don Guillett Sep 17, 2004 #4 try Sub findlargest() x = Application.Match(Application.Max(Columns(9)), Columns(9)) MsgBox x End Sub
try Sub findlargest() x = Application.Match(Application.Max(Columns(9)), Columns(9)) MsgBox x End Sub
D Don Guillett Sep 17, 2004 #5 What I gave offers the row. If all you want is the number, try this. x = Application.Max(Columns(9)