ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   RoundUp Sub/Routine not defined (https://www.excelbanter.com/excel-programming/388862-roundup-sub-routine-not-defined.html)

dkaydkay

RoundUp Sub/Routine not defined
 
I'm trying to use the Roundup worksheet function in a VBA formula and I'm
getting a "Compile Error: Sub or Function not defined". I thought I should
be able to use this function in VBA. Any help would be greatly appreciated.
Thanks!

JE McGimpsey

RoundUp Sub/Routine not defined
 
This works for me:

Dim dResult As Double
dResult = Application.WorksheetFunction.RoundUp(Range("A1"). Value, 2)

In article ,
dkaydkay wrote:

I'm trying to use the Roundup worksheet function in a VBA formula and I'm
getting a "Compile Error: Sub or Function not defined". I thought I should
be able to use this function in VBA. Any help would be greatly appreciated.
Thanks!


Tom Ogilvy

RoundUp Sub/Routine not defined
 
demo'd from the immediate window:

? application.Roundup(123.456,1)
123.5

works for me.

--
Regards,
Tom Ogilvy


"dkaydkay" wrote:

I'm trying to use the Roundup worksheet function in a VBA formula and I'm
getting a "Compile Error: Sub or Function not defined". I thought I should
be able to use this function in VBA. Any help would be greatly appreciated.
Thanks!



All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com