Thread: Max Question
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JulieD JulieD is offline
external usenet poster
 
Posts: 618
Default 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