Max Question

  • Thread starter Thread starter Greg B
  • Start date Start date
G

Greg B

How do I get excel to look up the highest value in column d and then copy
both the value and the corresponding value in column a

Thanks in advance

Greg
 
Hi Greg

the following code returns two variables
i - for the maximum value in column D
j - for the value in column A of the same row as i

Sub getmax()
i = Application.WorksheetFunction.Max(Range("D:D"))
j = Application.WorksheetFunction.Lookup(i, Range("D:D"), Range("A:A"))
End Sub



Cheers
JulieD
 
you're welcome - let us know if you need anything else
(ps what part of Oz are you in?)
 

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