Example

sbNextFloat

Appendix Programmcode sbNextFloat

Bitte den Haftungsausschluss im Impressum beachten.

Option Explicit

Function sbNextFloat(d As Double, Optional bUp As Boolean = True) As Double
'Returns the smallest double which is greater than the input (bUp = True)
'or the greatest double which is smaller than the input value (bUp = False).
'Source (EN): http://www.sulprobil.de/sbnextfloat_en/
'Source (DE): http://www.berndplumhoff.de/sbnextfloat_de/
'(C) (P) by Bernd Plumhoff 03-Oct-2010 PB V0.11
sbNextFloat = d - (2# * bUp + 1#) * CDbl("1e" & Right(Format(d, "." & _
              String(15, "0") & "E+000"), 4) - 15)
End Function

Download

Bitte den Haftungsausschluss im Impressum beachten.

sbNextFloat.xlsm [17 KB Excel Datei, ohne jegliche Gewährleistung]