+ Reply to Thread
Results 1 to 3 of 3

How to prevent cell rounding

  1. #1
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    135

    How to prevent cell rounding

    I am using the following code to run through up to 100 locations and create a result in column E. Initially this worked fine, but now it is rounding numbers. For example in column B, I may have a value of 175.61 and in column C a value of 350.00. I am trying to subtract column B from column C and get the results of 174.39 that is posted in column E. However, the result in rounding the number to just 174.00 not showing the remainder in column E.

    My code is
    Please Login or Register  to view this content.
    Any idea how I can stop this? Column E is formated with 2 decimal places.

  2. #2
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    135

    Re: How to prevent cell rounding

    Well I just resolved it by changing the the cvalue from integer and declaring it as a double. Dim cvalue as Double. It now work fine.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,094

    Re: How to prevent cell rounding

    You need to declare cvalue as double not integer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Prevent macro from rounding off when adding
    By bambino86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2022, 11:16 PM
  2. Banker's Round/Half to Even Rounding Double Rounding
    By CastorSunshine in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-01-2019, 02:51 PM
  3. Prevent button sending e mail and prevent closure of spreadsheet
    By Robbosan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2018, 11:22 AM
  4. [SOLVED] Rounding problems using lookup instead of rounding functions
    By thnkfree in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-18-2014, 06:21 PM
  5. Cell Rounding Macro - significant digits is variable from cell to cell
    By schmidt62 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2012, 05:06 PM
  6. [SOLVED] prevent rounding up
    By jhahes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2006, 03:40 PM
  7. how to prevent numbers in spread sheet from rounding
    By BSA in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 10-19-2005, 02:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1