How can I find a minimum value in a range of data in excelHow can I find a minimum value in a range of data in excel, select the select first to see where it is and then omit that value from the range and then do this process again for the next minimum value? so that in the end I can omit for example 100 minimum values from a range of 1000 values<br/>© 2009 Microsoft Corporation. All rights reserved.Wed, 05 Aug 2009 03:12:43 Z8e9329f8-da4a-407c-934d-712890bc2cebhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#8e9329f8-da4a-407c-934d-712890bc2cebhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#8e9329f8-da4a-407c-934d-712890bc2cebsolmaz moshirihttp://social.msdn.microsoft.com/Profile/en-US/?user=solmaz%20moshiriHow can I find a minimum value in a range of data in excelHow can I find a minimum value in a range of data in excel, select the select first to see where it is and then omit that value from the range and then do this process again for the next minimum value? so that in the end I can omit for example 100 minimum values from a range of 1000 values<br/>Thu, 02 Jul 2009 14:47:46 Z2009-07-02T14:47:46Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#26f84d87-4316-4331-8ceb-0dc89f15f7fbhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#26f84d87-4316-4331-8ceb-0dc89f15f7fbADGhttp://social.msdn.microsoft.com/Profile/en-US/?user=ADGHow can I find a minimum value in a range of data in excel<p>Hi, not exactly sure what you are trying to do but he below might give you some ideas:<br/><br/><br/>Public Sub test(rng As Range)<br/>Dim minValue<br/>Dim lngCounter As Long</p> <p>lngCounter = 0<br/>While lngCounter &lt; 100<br/>    minValue = Application.WorksheetFunction.Min(rng)<br/>    <br/>    Debug.Print minValue<br/>    For Each c In rng<br/>        If c.Value = minValue And lngCounter &lt; 100 Then<br/>            c.ClearContents<br/>             lngCounter = lngCounter + 1<br/>        End If<br/>    Next<br/>Wend<br/>End Sub</p>Thu, 02 Jul 2009 15:11:04 Z2009-07-02T15:11:04Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#cf207e1d-a01c-4394-a1f9-9b5b2ee88152http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#cf207e1d-a01c-4394-a1f9-9b5b2ee88152Shasurhttp://social.msdn.microsoft.com/Profile/en-US/?user=ShasurHow can I find a minimum value in a range of data in excelyou can try something like<br/><br/>c.copy destination:=Range(&quot;L2&quot;)<br/><br/>Cheers<br/>Shasur<hr class="sig">http://www.vbadud.blogspot.comFri, 03 Jul 2009 02:06:39 Z2009-07-03T02:06:39Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#5532c969-cc76-4184-9454-27c90bd6c523http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#5532c969-cc76-4184-9454-27c90bd6c523solmaz moshirihttp://social.msdn.microsoft.com/Profile/en-US/?user=solmaz%20moshiriHow can I find a minimum value in a range of data in excelHi again Shasur, thanks for your help yesterday, I changed your code to the following but it does not work, I'm foolishly playing with it but it does not understand: cell.select<br/> <br/> what I want to do is to find for example 5 minimums in the range D1:D8761. then cut this value and the values in the same row in the B and C columns and paste them all in another sheet. <br/> <br/> Sub Claim()<br/> Dim minval As Single, alfa As Range, a, b As Integer<br/> <br/> Set alfa = ThisWorkbook.Sheets(&quot;Energy Profit&quot;).Range(&quot;D1:D8761&quot;)<br/> <br/> a = 1<br/> <br/> lngCounter = 0<br/> <br/> While lngCounter &lt; 5<br/> minval = Application.WorksheetFunction.min(alfa)<br/> <br/> For Each cell In alfa<br/> If cell.Value = minval And lngCounter &lt; 5 Then<br/> cell.Select<br/> <br/> cell.Offset(0, -2).Select<br/> ActiveCell.Interior.ColorIndex = 34<br/> ActiveCell.Cut<br/> ThisWorkbook.Sheets(&quot;D2&quot;).Cells(a, 1).Select<br/> ActiveSheet.Paste<br/> <br/> cell.Offset(0, -1).Select<br/> ActiveCell.Cut<br/> ThisWorkbook.Sheets(&quot;D2&quot;).Cells(a, 2).Select<br/> ActiveSheet.Paste<br/> <br/> cell.Select<br/> cell.Cut<br/> ThisWorkbook.Sheets(&quot;D2&quot;).Cells(a, 3).Select<br/> ActiveSheet.Paste<br/> <br/> a = a + 1<br/> <br/> lngCounter = lngCounter + 1<br/> End If<br/> Next<br/> Wend<br/> <br/> End Sub<br/>Fri, 03 Jul 2009 11:47:44 Z2009-07-03T11:47:44Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#af6c43a7-1d2b-4c96-a91e-2206f696c1dbhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/8e9329f8-da4a-407c-934d-712890bc2ceb#af6c43a7-1d2b-4c96-a91e-2206f696c1dbShasurhttp://social.msdn.microsoft.com/Profile/en-US/?user=ShasurHow can I find a minimum value in a range of data in excel<p>Hi<br/><br/>Instead of <br/><br/>cell.Select</p> <p>cell.Offset(0, -2).Select<br/>ActiveCell.Interior.ColorIndex = 34<br/>ActiveCell.Cut<br/>ThisWorkbook.Sheets(&quot;D2&quot;).Cells(a, 1).Select<br/>ActiveSheet.Paste</p> <p>You can try the following<br/><br/>cell.Offset(0, -2).Cut Destination:=ThisWorkbook.Sheets(&quot;D2&quot;).Cells(a, 1)<br/><br/>Cheers<br/>Shasur</p><hr class="sig">http://www.vbadud.blogspot.comSun, 12 Jul 2009 02:19:52 Z2009-07-12T02:19:52Z