Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Two steps:
1. determine the lowest non-zero number: =SMALL(B10:B25,1) and if this is zero use =SMALL(B10:B25,2) 2. find the row: use MATCH() on the result of step 1 -- Gary's Student "Peter Rooney" wrote: Good morning all, Can anyone suggest a quick way of returning the row number of the lowest cell in a range (e.g. B10:B25) that contains a non-zero value? I thought of a nested loop where the value of each cell is tested and the row number stored is to a varable if it is greater than the value already stored there, but this needs to be part of a worksheet_change macro and it might slow things down too much doing things in this way. Thanks in advance Pete |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I didn't make myself clear.
The purpose of the exercise is to determine how far down a worksheet a "Cumulative Hours" formula needs to be copied, so I don't have a column containing unnecessary identical cumulative values where there isn't a corresponding actual (the X axis, actuals and cumulatives are in columns B, C and D) I'm trying to do this in VBA - not in the actual worksheet. Sorry if I wasted your time before! Pete "Gary''s Student" wrote: Two steps: 1. determine the lowest non-zero number: =SMALL(B10:B25,1) and if this is zero use =SMALL(B10:B25,2) 2. find the row: use MATCH() on the result of step 1 -- Gary's Student "Peter Rooney" wrote: Good morning all, Can anyone suggest a quick way of returning the row number of the lowest cell in a range (e.g. B10:B25) that contains a non-zero value? I thought of a nested loop where the value of each cell is tested and the row number stored is to a varable if it is greater than the value already stored there, but this needs to be part of a worksheet_change macro and it might slow things down too much doing things in this way. Thanks in advance Pete |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I didn't make myself clear.
The purpose of the exercise is to determine how far down a worksheet a "Cumulative Hours" formula needs to be copied, so I don't have a column containing unnecessary identical cumulative values where there isn't a corresponding actual (the X axis, actuals and cumulatives are in columns B, C and D) I'm trying to do this in VBA - not in the actual worksheet. Sorry if I wasted your time before! Pete "Gary''s Student" wrote: Two steps: 1. determine the lowest non-zero number: =SMALL(B10:B25,1) and if this is zero use =SMALL(B10:B25,2) 2. find the row: use MATCH() on the result of step 1 -- Gary's Student "Peter Rooney" wrote: Good morning all, Can anyone suggest a quick way of returning the row number of the lowest cell in a range (e.g. B10:B25) that contains a non-zero value? I thought of a nested loop where the value of each cell is tested and the row number stored is to a varable if it is greater than the value already stored there, but this needs to be part of a worksheet_change macro and it might slow things down too much doing things in this way. Thanks in advance Pete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Question about returning some values from highest to lowest | Excel Discussion (Misc queries) | |||
Looking up a named range and returning value into a cell | Excel Discussion (Misc queries) | |||
looking for another same value cell in a range and returning a coresponding value | Excel Worksheet Functions | |||
Range vs. lowest #, 2nd lowest #, 3rd lowest #, etc | Excel Discussion (Misc queries) | |||
How can I get the lowest price, second lowest etc. from a range o. | Excel Worksheet Functions |