View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default TextBox Formatting

dim myVal as double
myval = 1.4
me.textbox1.value = round(myval,0)

if you're using xl97:
me.textbox1.value = application.round(myval,0)


grahammal wrote:

How do I format a UserForm TextBox to round decimal numbers to the
nearest whole number.
ie
1.0, 1.1, 1.2, 1.3, 1.4 should all round down to 1.
1.5, 1.6, 1.7, 1.8, 1.9 should all round up to 2.
I can get it to display the Interger but this always rounds down.

--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=532225


--

Dave Peterson