ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Max Question (https://www.excelbanter.com/excel-programming/325217-max-question.html)

Greg B[_4_]

Max Question
 
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



JulieD

Max Question
 
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


"Greg B" wrote in message
...
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




Greg B[_4_]

Max Question
 
Ok thank you

Greg



JulieD

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

"Greg B" wrote in message
...
Ok thank you

Greg




Greg B[_4_]

Max Question
 
Adelaide



JulieD

Max Question
 
Perth

"Greg B" wrote in message
...
Adelaide





All times are GMT +1. The time now is 06:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com