roundup

Hans810

Board Regular
Joined
Dec 1, 2005
Messages
63
Hi there,


I cannot get the RoundUp formula working in VBA!

Part of the VBA:

xxx declared as Double

xx = Range("F" & n)
xxx = xx * 1 (to make integer from text)
xxxx = RoundUp(xxx, 0)

Can anyone help me on what I am (possibly) doing wrong???

Thx in advance.

BR hans
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi there,


I cannot get the RoundUp formula working in VBA!

Part of the VBA:

xxx declared as Double

xx = Range("F" & n)
xxx = xx * 1 (to make integer from text)
xxxx = RoundUp(xxx, 0)

Can anyone help me on what I am (possibly) doing wrong???

Thx in advance.

BR hans

Greetings Hans,

Not sure about the need to convert from text to "integer" (single?), but would this work?

xx = Application.WorksheetFunction.Roundup(CInt(Trim(Range("A" & n))), 0)

Hope this helps,

Mark
 
Upvote 0
Hi GTO,

Yours does not quite do what I wanted!
The answer of the first replier works well.
I have not yet figured out why yours is not working!
I found that your expression is not rounding up, but rouding down.

Anyway, Thanks.
Have a nice day,, hans
 
Upvote 0

Forum statistics

Threads
1,216,106
Messages
6,128,863
Members
449,473
Latest member
soumyahalder4

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top