Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Determining an Integer Value.
by Allen Wyatt
(last updated September 28, 2013)
VBA, true to its BASIC roots, provides a function to return the integer value of an expression. This means that anything to the right of the decimal point is truncated. Thus, if a formula would normally result in a value such as 18.73, then the integer value of that formula would result in 18.
The syntax for the integer function is as follows:
x = Int(y)
where x is the result and y is a value or an expression that evaluates to a value.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11816) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Determining an Integer Value.
Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!
If your documents include words that contain numbers (such as a list of parts numbers) you may need a way to increment those ...Discover More
Functions can be used to perform repetitive tasks and return values to your main program. You can also pass values to a ...Discover More
Sometimes it is helpful to know how often a particular phrase appears within a document. If you need to know such a count, ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.