Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Function MinChar(ParamArray Values() As Variant)
Dim I As Long Dim L As Long Dim v As Variant K = Chr(255) + Chr(255) For I = 0 To UBound(Values) If IsArray(Values(I)) Then v = Values(I) For L = LBound(v) To UBound(v) If VarType(Values(I)(L, 1)) = vbString Then If K Values(I)(L, 1) Then K = Values(I)(L, 1) End If End If Next Else If K Values(I) Then K = Values(I) End If End If Next I MinChar = K End Function -- Regards, Tom Ogilvy "RincewindWIZZ" wrote in message news:RincewindWIZZ.1plzz8_1117060753.3163@excelfor um-nospam.com... Sorry, it makes no difference. MinChar is Function MinChar(ParamArray Values() As Variant) Dim I As Integer K = Chr(255) + Chr(255) For I = 0 To UBound(Values) If K Values(I) Then K = Values(I) End If Next I MinChar = K End Function (or its eqUivalent using a range) Using Debug, MinChar exits with K = correct minimum value (say "Alphonse") In the spreadsheet, the next thing that happens is the cell takes the value #VALUE I suspect I am missing something simple (I hope!) tfai -- RincewindWIZZ ------------------------------------------------------------------------ RincewindWIZZ's Profile: http://www.excelforum.com/member.php...o&userid=20622 View this thread: http://www.excelforum.com/showthread...hreadid=373901 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom Function I can use in a formula? | Excel Discussion (Misc queries) | |||
Custom Function in Array Formula | Excel Programming | |||
Passing an array as argument for custom Function | Excel Programming | |||
Preformatted array returned by custom function | Excel Programming | |||
returning an array from a custom function | Excel Programming |