Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
If your input is in cells A1:A10 then select cells D1:F3, for example, and array-enter (enter with CTRL + SHIFT + ENTER, not just ENTER): =idsets(A1:A10) The UDF idsets: Function idsets(r As Range) As Variant Dim v, vR(1 To 100, 1 To 3) Dim i As Long, m As Long, b As Boolean Dim lmin As Long, lmax As Long m = 2147483647 b = False For Each v In r If v < m Then 'New set If b Then i = i + 1 vR(i, 1) = "Set " & i vR(i, 2) = lmin vR(i, 3) = lmax Else b = True End If m = v lmin = m lmax = m Else If v lmax Then lmax = v If v < lmin Then lmin = v End If m = v Next v i = i + 1 vR(i, 1) = "Set " & i vR(i, 2) = lmin vR(i, 3) = lmax idsets = vR End Function Press ALT + F11, insert a new module and copy function text into new module, finally switch back to worksheet and press F9. Regards, Bernd |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
formula to add a number to a long string ** | Excel Worksheet Functions | |||
parsing a string for 3 sets of numbers | Excel Programming | |||
Extract sub-string of number from field of long series of numbers | Excel Worksheet Functions | |||
Extract Numbers from Alpha-Numeric String | Excel Worksheet Functions | |||
search to identify duplicate enties in long columns of numbers | Excel Discussion (Misc queries) |