#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Rounding Up

Im needing a code to round up not down
100.1 = needs to be 101
100.2 = needs to be 101
100.9 = needs to be 101

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,345
Default Rounding Up

Check out the CEILING() function.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Mike" wrote in message
...
Im needing a code to round up not down
100.1 = needs to be 101
100.2 = needs to be 101
100.9 = needs to be 101




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Rounding Up

In need it to be in vba this is what I have. If the sum of
rs.Fields("SumOfRTL_QTY").Value / 10 is a decimal just round up to the next
Integer
ThisWorkbook.Worksheets(1).Range(AD & i) = _rs.Fields("SumOfRTL_QTY").Value
/ 10

"Sandy Mann" wrote:

Check out the CEILING() function.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Mike" wrote in message
...
Im needing a code to round up not down
100.1 = needs to be 101
100.2 = needs to be 101
100.9 = needs to be 101





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Rounding Up

Int(rs.Fields("SumOfRTL_QTY").Value / 10 +1))
--
Best regards,
Edward


"Mike" wrote:

In need it to be in vba this is what I have. If the sum of
rs.Fields("SumOfRTL_QTY").Value / 10 is a decimal just round up to the next
Integer
ThisWorkbook.Worksheets(1).Range(AD & i) = _rs.Fields("SumOfRTL_QTY").Value
/ 10

"Sandy Mann" wrote:

Check out the CEILING() function.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Mike" wrote in message
...
Im needing a code to round up not down
100.1 = needs to be 101
100.2 = needs to be 101
100.9 = needs to be 101





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default Rounding Up


Public Function Ceil(dblSource As Double) As Long
Dim dblFloor As Double

dblFloor = Int(dblSource)
If dblFloor = dblSource Then
Ceil = dblFloor
Else
Ceil = dblFloor + 1
End If
End Function




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Rounding Up

ThisWorkbook.Worksheets(1).Range(AD & i) =
Application.Ceiling(_rs.Fields("SumOfRTL_QTY").Val ue / 10,1)


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Mike" wrote in message
...
In need it to be in vba this is what I have. If the sum of
rs.Fields("SumOfRTL_QTY").Value / 10 is a decimal just round up to the
next
Integer
ThisWorkbook.Worksheets(1).Range(AD & i) =
_rs.Fields("SumOfRTL_QTY").Value
/ 10

"Sandy Mann" wrote:

Check out the CEILING() function.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Mike" wrote in message
...
Im needing a code to round up not down
100.1 = needs to be 101
100.2 = needs to be 101
100.9 = needs to be 101







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,345
Default Rounding Up

Try something like:

If int(rs.Fields("SumOfRTL_QTY").Value / 10 ) < _
rs.Fields("SumOfRTL_QTY").Value / 10 then _
ThisWorkbook.Worksheets(1).Range(AD & i) = _
Int(rs.Fields("SumOfRTL_QTY").Value/10)+1
Else
ThisWorkbook.Worksheets(1).Range(AD & i) = _
rs.Fields("SumOfRTL_QTY").Value / 10


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Mike" wrote in message
...
In need it to be in vba this is what I have. If the sum of
rs.Fields("SumOfRTL_QTY").Value / 10 is a decimal just round up to the
next
Integer
ThisWorkbook.Worksheets(1).Range(AD & i) =
_rs.Fields("SumOfRTL_QTY").Value
/ 10

"Sandy Mann" wrote:

Check out the CEILING() function.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Mike" wrote in message
...
Im needing a code to round up not down
100.1 = needs to be 101
100.2 = needs to be 101
100.9 = needs to be 101








Reply
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
ROUNDING FORMULA =ROUND(B12/$B$10,1) ROUNDING TO HIGH SunshineinFt.Myers[_2_] Excel Worksheet Functions 7 March 5th 09 06:41 PM
Rounding up Kavi Excel Worksheet Functions 1 October 24th 08 09:16 AM
I need a formula with rounding up & rounding down to the nearest . Tony Kay Excel Worksheet Functions 3 May 29th 07 11:13 PM
Rounding off to .48 or .98 Mark4253 Excel Discussion (Misc queries) 9 February 5th 07 02:13 AM
Worksheet rounding vs VBA rounding Simon Cleal Excel Programming 4 September 2nd 05 01:50 AM


All times are GMT +1. The time now is 09:42 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"