Userform to roundup decimals to the nearest 0.25 or 0.5 or 0.75

Apple08

Active Member
Joined
Nov 1, 2014
Messages
450
Hi everyone

I have to roundup an userform decimal places to the nearest 0.25 or 0.5 or 0.75. I use the following formula but it is only to set the decimal place to two digits but cannot round up. Please can anyone help?

tBox3 = Format(Round(Val(WordCount) / Range("$C$21") * 1.3, 2), "0" & Application.DecimalSeparator & "00")

Any help is appreciated.
 
so if you have wordcount 1090. I do 1090/13*1.3 and I am getting 1.552026, then I user ceiling(1.552026,0.25) and I get 1.75. Is that not what you want?
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Yes that's what I want, so I can't understand why it doesn't work:

TextBox3.Value = WorksheetFunction.Ceiling(Val(WordCount) / Range("$C$21") * 1.3, 0.25)

Have I put it in the right way?
 
Upvote 0
have you tried to do: TextBox3.Value = format(WorksheetFunction.Ceiling(Val(WordCount) / Range("$C$21") * 1.3, 0.25),"0.00")
 
Upvote 0
If you ran this just before you run the textbox line what is the message box saying:

Code:
MsgBox WorksheetFunction.Ceiling(Val(WordCount) / Range("$C$21") * 1.3, 0.25)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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