![]() |
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 |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 01:56 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com