Macro Question

  • Thread starter Thread starter Beth0202
  • Start date Start date
B

Beth0202

How do you write a macro that specifices the largest number result in
range of values
 
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
 
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
 
try

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top