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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
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,216,172
Messages
6,129,290
Members
449,498
Latest member
Lee_ray

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