Macro Question

B

Beth0202

How do you write a macro that specifices the largest number result in
range of values
 
J

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

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

try

Sub findlargest()
x = Application.Match(Application.Max(Columns(9)), Columns(9))
MsgBox x
End Sub
 
D

Don Guillett

What I gave offers the row. If all you want is the number, try this.
x = Application.Max(Columns(9)
 
Top