Rounding up in a userform

seacrest

Active Member
Joined
Aug 15, 2002
Messages
301
Hi,

I need some help with rounding up to the nearest 100 in a textbox userform
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,248
Office Version
  1. 365
Platform
  1. Windows
Care to give us a bit more info?
 

mohadin

Well-known Member
Joined
Mar 22, 2015
Messages
1,088
Office Version
  1. 2013
Platform
  1. Windows
What about
VBA Code:
TextBox1.Value = WorksheetFunction.Ceiling(90, 100)
 

seacrest

Active Member
Joined
Aug 15, 2002
Messages
301
Just need to round up to the nearest 100 for the following code
TextBox9.Value = TextBox7.Value * TextBox8.Value
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,248
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

How about
VBA Code:
TextBox9.Value = Application.Ceiling(TextBox7.Value * TextBox8.Value,100)
 
Solution

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,852
Office Version
  1. 2010
Platform
  1. Windows
With regard to mohadin and Fluff's suggestion to use the Ceiling function (referencing either WorksheetFunction or Application) , I just want to point out to those who might not be aware there is a VBA equivalent of the Excel CEILING.MATH function (like the CEILING function but has an option on how to deal with negative values) called Ceiling_Math (again, referencing either WorksheetFunction or Application) whose arguments are the same as the CEILING.MATH function.
 

mohadin

Well-known Member
Joined
Mar 22, 2015
Messages
1,088
Office Version
  1. 2013
Platform
  1. Windows
With regard to mohadin and Fluff's suggestion to use the Ceiling function (referencing either WorksheetFunction or Application) , I just want to point out to those who might not be aware there is a VBA equivalent of the Excel CEILING.MATH function (like the CEILING function but has an option on how to deal with negative values) called Ceiling_Math (again, referencing either WorksheetFunction or Application) whose arguments are the same as the CEILING.MATH function.
Thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,126,978
Messages
5,621,942
Members
415,868
Latest member
Pita

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
Top