User Tools

Site Tools


vba:functions:ceil

This is an old revision of the document!


Table of Contents

[VBA] ceil()

Liefert die nächste ganze Zahl, die größer oder gleich dem Inputparameter ist.

Definition

double = ceil(zahl)
Public Function ceil(ByVal iValue As Variant) As Double
  • iValue Wert, der aufgerundet werden soll

Beispiele

?ceil(17.512)
 18 
 
?ceil(17.009)
 18 <code>
 
===== Code =====
<code vb udf_ceil>'-------------------------------------------------------------------------------
'File         : udf_ceil.bas
'               Copyright mpl by ERB software
'               All rights reserved
'               http://wiki.yaslaw.info/dokuwiki/doku.php/vba/functions/concat
'Environment  : VBA 2010 +
'Version      : 1.0.0
'Name         : ceil
'Author       : Stefan Erb (ERS)
'History      : 16.06.2014 - ERS - Creation
'-------------------------------------------------------------------------------
Option Explicit
 
'/**
' * Rundet eine Zahl auf. Das gegenteil von fix()
' *
' *     double = ceil(zahl)
' *
' * @param  Variant
' * @return Double
' */
Public Function ceil(ByVal iValue As Variant) As Double
    ceil = Fix(iValue + 0.9999999999)
End Function
vba/functions/ceil.1404814715.txt.gz · Last modified: 08.07.2014 12:18:35 by yaslaw