RoundUp, RoundDown, Ceiling Application.WoorksheetFunction(s)

B

bad_boyu

Hello,

Is there a VB code that replaces RoundUp, RoundDown and Ceiling
functions from Excel? Or an explanation of how they work so I can
implement them?

Thanks in advance,
O
 
C

Chip Pearson

You can call Excel worksheet functions in VBA by going through
the WorksheetFunctions class. E.g.,

Dim Result As Variant
Result = Application.WorksheetFunction.RoundDown(123.45, 1)
Debug.Print Result

The only worksheet functions that are not accessible in this
manner are those that have direct VBA function counterparts, such
as Month or Year.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Top