ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   finding min values address and getting value from same column (https://www.excelbanter.com/excel-programming/356724-finding-min-values-address-getting-value-same-column.html)

[email protected]

finding min values address and getting value from same column
 
ok here is what i have.

A B C D E
1 V W X Y
2 1.95 1.55 1.75 2.05 #Display


now in cell E2 i want it to find the minimum value from A2 to D2 and
display the letter above that minimum values column found in row 1
(V,W,X or Y).

so in this example i want W to be displayed in Cell E2.

thank you,
Jonathan


Alseikhan[_3_]

finding min values address and getting value from same column
 

This should do the trick:

Sub test()
Dim rng As Range
Worksheets("Sheet1").Range("A2:D2").Select
Set rng = Selection.Find(What:=Application.min(Selection)
Lookat:=xlWhole, LookIn:=xlValues)
Range("E2") = rng.Offset(-1, 0)
End Sub

Alseikha

--
Alseikha
-----------------------------------------------------------------------
Alseikhan's Profile: http://www.excelforum.com/member.php...fo&userid=3236
View this thread: http://www.excelforum.com/showthread.php?threadid=52502



All times are GMT +1. The time now is 04:43 AM.

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