Nejni₧Üφ hodnota pole

Funkce:
'Parametry FIRST a LAST indikujφ, kterou Φßst pole zpracovat. 
'Pokud nejsou zadßny, bere se celΘ pole. 
'Pokud je vlo₧ena prom∞nnß pro MININDEX, 
'funkce jφ p°i°adφ hodnotu indexu nejv∞tÜφho elementu

Function ArrayMin(arr As Variant, Optional ByVal First As Variant, _ 
   Optional ByVal Last As Variant, _
   Optional MinIndex As Long) As Variant 

   Dim Index As Long 

   If IsMissing(First) Then First = LBound(arr) 
   If IsMissing(Last) Then Last = UBound(arr) 

   ArrayMin = arr(First) 

   For Index = First + 1 To Last 
      If ArrayMin < arr(Index) Then 
         ArrayMin = arr(Index) 
         MinIndex = Index 
         End If 
   Next 

End Function

Zp∞t

Autor: The Bozena