Function CellMinAddress(Plage As Range) As String CellMinAddress = Plage.Columns.Find(Application.WorksheetFunction.Min(Plage)).Address End Function
Sub TEST() Range(CellMinAddress(Range("a:a"))).Select End Sub
Function CellValueNext(plage As Range) As Double ' paramètres Dim t As Long Dim Min As Long Dim Max As Long Dim Cell As Range 'derniers enregistrement Min = Application.WorksheetFunction.Min(plage) Max = Application.WorksheetFunction.Max(plage) 'Algo ReDim pval(Max - Min) As Boolean For Each Cell In plage.Cells If Cell.Value > 0 Then pval(Cell.Value - Min) = True Next For t = 0 To Max - Min If pval(t) = False Then CellValueNext = t + Min Exit For End If Next t End Function
Sub Recherche() MsgBox CellValueNext(Range("a:a")) End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question