Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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 07:41 PM
Prevent EXCEL from rounding the result of a calculation elusiverunner Excel Discussion (Misc queries) 3 January 9th 08 09:38 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
HOW CAN I PREVENT EXCEL FILES FROM BEING DELETED OR PREVENT TRASH ROB Excel Discussion (Misc queries) 2 April 2nd 07 01:13 PM
HOW TO PREVENT NUMBERS IN SPREAD SHEET FROM ROUNDING BSA New Users to Excel 1 October 19th 05 06:26 PM


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