LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default VB Round( ) function

If in a cell on a spreadsheet, I enter the following equation:
=ROUND(50.5, 0)
I obtain the result 51, which I would expect, since 0.5 should be rounded
up.

If I write the following VB funcion:

Function RoundFunc(Mark As Integer) As Integer
RoundFunc = Round(Mark, 0)
End Function

And then enter the following equation into a cell:
=RoundFunc(50.5)

I obtain the result 50. i.e. 0.5 is rounded down

Why the difference? Is there a function that I can use in my VB code that
will round 0.5 up rather than down?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Round Function duketter Excel Worksheet Functions 5 February 24th 10 08:46 PM
Round function plantslayer Excel Discussion (Misc queries) 3 June 4th 08 05:49 PM
how do i set up round function run superman Excel Worksheet Functions 1 October 6th 05 08:13 PM
help with round function Scott Excel Worksheet Functions 7 February 9th 05 07:23 PM
Round Function Pedro Serra Excel Discussion (Misc queries) 4 January 27th 05 06:13 PM


All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"