Results 1 to 4 of 4

Sum of range picking up ^-10 decimal place. Is there a way to sum 2 decimal place only?

Threaded View

  1. #1
    Registered User
    Join Date
    07-16-2015
    Location
    Brighton, England
    MS-Off Ver
    2010
    Posts
    71

    Sum of range picking up ^-10 decimal place. Is there a way to sum 2 decimal place only?

    Hi, thanks for looking.

    I am looking for a solution to sum only values up to 2 decimal place.

    I have a macro that is currently summing a range and coloring yellow until it meets a certain value.

    I have an error handler (at the bottom of the code), re-summing the yellow cells checking to ensure it has definitely matched the certain value. It is throwing out the error handling I have created 20% of the time due, and I have found that it is due to values that are below 0.01 value.

    Thanks for your help

           
    
         VVar.Select
         For Each rngCell In Range(Selection, Selection.End(xlDown))
           xSum = rngCell.Value + xSum'<< I need to somehow make this pick up only 2 decimal places?
           rngCell.Interior.Color = vbYellow
           If xSum = TopV Then
           Exit For
           End If
         Next
    'here is my checking errorhandler
     VVar.Select
                For Each rngCell In Range(Selection, Selection.End(xlDown))
                If rngCell.Interior.Color = vbYellow Then
                vsum = rngCell.Value + vsum 
                End If
            Next rngCell
     If vsum <> TopV Then
                 MsgBox "Sorry, something has gone wrong. Please manually highlight past dues in workbook - " & ActiveWorkbook.Name & vsum & TopV, vbOKOnly
                 VVar.Select
                 Range(Selection, Selection.End(xlDown)).Interior.Color = vbWhite
            End If
    Last edited by graym463; 08-20-2015 at 05:45 PM. Reason: fuller version of code

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Cannot change decimal place's?
    By nostrum in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-01-2014, 11:12 AM
  2. Add one decimal place to each cell in a range
    By rob_ford16 in forum Excel General
    Replies: 1
    Last Post: 03-13-2014, 09:16 PM
  3. Check/Validate range for 4 decimal place input only
    By aprusik in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-01-2013, 07:59 PM
  4. Decimal place Help
    By cadk73 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-26-2012, 03:56 PM
  5. Decimal Place Help
    By cadk73 in forum Excel General
    Replies: 4
    Last Post: 02-14-2012, 08:11 PM
  6. Decimal Place
    By Pale Cloud in forum Excel General
    Replies: 6
    Last Post: 04-06-2011, 05:54 AM
  7. Replies: 3
    Last Post: 03-18-2006, 02:25 PM

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