A family of Microsoft word processing software products for creating web, email, and print documents.
In that VBA code, Ceiling is a function that rounds a number up to the next whole unit (or to the next multiple of a given significance, depending on how it is defined). In Access web apps and in Excel/Word VBA, the idea is the same: return the smallest integer greater than or equal to the given value.
Conceptually for this line:
ExtraLines = Ceiling(EnglishWidthIn / AvailableWidthIn) - 1
-
EnglishWidthIn / AvailableWidthIncalculates how many “line widths” are needed to fit the text. -
Ceiling(...)rounds that value up to the next whole number of lines (because even 1.01 lines means 2 full lines are needed). - Subtracting 1 gives the number of extra lines beyond the first.
Example: if EnglishWidthIn / AvailableWidthIn = 2.1, then:
-
Ceiling(2.1)= 3 -
ExtraLines = 3 - 1 = 2extra lines.
In Microsoft documentation, the Ceiling function is defined as:
- Excel/SharePoint/Word-style CEILING: returns a number rounded up, away from zero, to the nearest multiple of a specified significance.
- Access custom web app Ceiling: returns the smallest integer greater than or equal to the numeric expression.
So in this code, Ceiling is being used to ensure the number of lines is always rounded up so the text always fits.
References: