LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Rounding Nearest Dollar

Hello,
Mike seems to be gone but could someone else tell me why this formula is in
consistant on round up from 50 cents to rounding down from 50 cents
Please, any help here and I would be grateful

Example:1
1,730.00 x 5% = 86.50 = 1,816.50 total
The code rounds it to 1,816.00
Example:2
30.00 x 5%=1.50= 31.50 total
The code rounds it to 32.00
Each example the answer ended in .50 cents but the code round down on the
first and up on the second.
I would really like for it to see .50 and round up all the time.

Sub ChangeEntPriceShtPricesColD_RndNearest_Dollor()
Dim Increase As Double
Dim c As Range
'
ReDim OldRange(Range("D101", Range("lastRow").Offset(-1, -1)).Count)
Set OldWkb = ActiveWorkbook
Set OldSht = ActiveSheet
'
For Each cell In Range("D101", Range("lastRow").Offset(-1, -1))
i = i + 1
OldRange(i).Address = cell.Address
OldRange(i).Values = cell.Formula
Next cell
'
On Error GoTo ErrorControl_1
Application.DisplayAlerts = False
Increase = Application.InputBox(prompt:="Enter the percentage increase
you desire" & Chr(13) & _
"for 5%, enter 5, not (.05.)" _
Title:="Round Nearest Dollar Increase", Left:=100, Type:=1)
'
For Each c In Intersect(Range("D101",
Range("lastRow").Offset(-1, -1)),
ActiveSheet.UsedRange)
If Not IsEmpty(c) Then c.Value = Round(c.Value * (1 + (Increase
/100)), 0)
Next
Application.DisplayAlerts = True
End Sub


 
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 to the nearest Dollar H New Users to Excel 2 July 7th 09 12:36 AM
rounding numbers to the nearest dollar amount HelpExcel Excel Worksheet Functions 11 April 6th 09 08:35 PM
Rounding up to the nearest dollar MLShef Excel Worksheet Functions 3 January 9th 07 01:01 AM
What is the formula for rounding a dollar amount to the nearest ni JeriSys New Users to Excel 5 December 22nd 05 06:54 PM
rounding to nearest hundred dollar in Excel Diane New Users to Excel 7 October 14th 05 04:25 PM


All times are GMT +1. The time now is 06:32 AM.

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

About Us

"It's about Microsoft Excel"