Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
prevent rounding up
I am exporting external data from a database into excel. There are 3 columns full of data that are exported into excel as tex format. They are A, C and D The problem I am having right now is that when I export the dat everything works however, when I run the following code it is changin exported data in a cell i.e.(4.75) to 5. Is there anyway to have thi remain the same without rounding up. Here is my code: Do ActiveCell.Value = CDbl(ActiveCell.Value) ActiveCell.Offset(1, 0).Select Loop Until ActiveCell.Value = "" Dim LastRowWithItemNumber As Integer LastRowWithItemNumber = ActiveCell.Row - 1 Dim cell As Range Range("C2").Select For Each cell In Range("C2:D" & LastRowWithItemNumber) If cell.Value < "" Then cell.Value = CLng(cell.Value) Next MsgBox "Update Finished -- jhahe ----------------------------------------------------------------------- jhahes's Profile: http://www.excelforum.com/member.php...fo&userid=2359 View this thread: http://www.excelforum.com/showthread.php?threadid=52579 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ROUNDING FORMULA =ROUND(B12/$B$10,1) ROUNDING TO HIGH | Excel Worksheet Functions | |||
Prevent EXCEL from rounding the result of a calculation | Excel Discussion (Misc queries) | |||
I need a formula with rounding up & rounding down to the nearest . | Excel Worksheet Functions | |||
HOW CAN I PREVENT EXCEL FILES FROM BEING DELETED OR PREVENT TRASH | Excel Discussion (Misc queries) | |||
HOW TO PREVENT NUMBERS IN SPREAD SHEET FROM ROUNDING | New Users to Excel |