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
Bookmarks