+ Reply to Thread
Results 1 to 7 of 7

summing by colour

  1. #1
    Registered User
    Join Date
    02-29-2012
    Location
    Sothampton
    MS-Off Ver
    Excel 2019
    Posts
    16

    Question summing by colour

    Assistant would be appreciated
    Iam trying to sum fields by Colour and use a function , the function gives the correct result providing the number are whole numbers, if they are for example 1.5 and 1.5 the result is 4 when I require it to be 3. I have formatted the fields to Currency 2 places . What am I missing ?

    Please Login or Register  to view this content.
    Regards Ypma
    Last edited by Ypma; 08-16-2020 at 09:46 AM. Reason: failed to code tag

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019; O365
    Posts
    19,163

    Re: summing by colour

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,686

    Re: summing by colour

    Change your Dim statement for the cSum variable from Long (which can only hold integer values) to Double (which can hold floating point numbers).

    As an aside, you should consider changing your other variable to Long instead of Integer. There is no real benefit on a modern computer to declaring a variable as an Integer.
    Last edited by Rick Rothstein; 08-16-2020 at 10:12 AM.

  4. #4
    Registered User
    Join Date
    02-29-2012
    Location
    Sothampton
    MS-Off Ver
    Excel 2019
    Posts
    16

    Re: summing by colour

    Rick , thank you very much , changing the Dim Statements produced the correct result that Ii was after . Thanks again

    Regard Bob

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019; O365
    Posts
    19,163

    Re: summing by colour

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  6. #6
    Registered User
    Join Date
    02-29-2012
    Location
    Sothampton
    MS-Off Ver
    Excel 2019
    Posts
    16

    Re: summing by colour

    I have duly marked the thread as SOLVED. How long before I am not a relatively new member ?

    Regards Ypma

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019; O365
    Posts
    19,163

    Re: summing by colour

    It is a canned response. I guess 8 years is not really relatively new.

+ 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] Summing by colour and category
    By dna247 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-30-2015, 06:59 AM
  2. Modifying a Custom Function that is Summing Cells based on Fill Colour
    By BLN355 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2014, 07:38 AM
  3. [SOLVED] Help with Summing Duplicates, deleting rows after summing and filling col. for unsummed
    By solidrock1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2014, 09:11 AM
  4. Summing figures of a certain colour
    By Badger123 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-13-2007, 07:02 PM
  5. Summing a range depending on cell background colour
    By Re: Inserting an option button in Word in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2005, 01:05 PM
  6. [SOLVED] Summing a range if a certain background colour
    By Re: Inserting an option button in Word in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-21-2005, 12:05 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