+ Reply to Thread
Results 1 to 11 of 11

Sum By Text Color Macro Not Working

  1. #1
    Registered User
    Join Date
    04-03-2015
    Location
    NY NY
    MS-Off Ver
    Office 365
    Posts
    38

    Sum By Text Color Macro Not Working

    I am trying to use the macro in the attached file to sum cells within a range by color. In the example I set up the G15 should be returning a value of 7 (the sum of the red values in the range), but I am getting a #NAME? error instead and im not quite sure where the coding error is coming from. I'm relatively certain my formula syntax is correct but could be wrong?

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sum By Text Color Macro Not Working

    Hello saq7792,

    Your approach is not quite correct.

    Please try;

    Please Login or Register  to view this content.
    Check the attached sample File.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Sum By Text Color Macro Not Working

    Strange, I could not get it to work either, then I just changed the Function name and the UDF worked.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: Sum By Text Color Macro Not Working

    The reason that you get #name? is the module & the function have the same name.
    Change the name of the module and it should work.

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Sum By Text Color Macro Not Working

    Quote Originally Posted by Fluff13 View Post
    The reason that you get #name? is the module & the function have the same name.
    Change the name of the module and it should work.
    Ah yes, I knew here was a confliction, never thought of that one.

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

    Re: Sum By Text Color Macro Not Working

    Must admit it took me awhile to suss it.

  7. #7
    Registered User
    Join Date
    04-03-2015
    Location
    NY NY
    MS-Off Ver
    Office 365
    Posts
    38

    Re: Sum By Text Color Macro Not Working

    Well, at least I was correct that my syntax was right

    Thanks for the help! This solved it, and a super easy fix at that.

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

    Re: Sum By Text Color Macro Not Working

    Glad to help & thanks for the feedback

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sum By Text Color Macro Not Working

    And my post seems to be ignored like a Stop sign.

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

    Re: Sum By Text Color Macro Not Working

    Who said that!

  11. #11
    Registered User
    Join Date
    04-03-2015
    Location
    NY NY
    MS-Off Ver
    Office 365
    Posts
    38

    Re: Sum By Text Color Macro Not Working

    Not at all, but I was feeling lazy and adding "VBA" to the end of the module name was ever so slightly easier than copy & pasting new code in the module

    I saved at least 4 or 5 seconds.

+ 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. Cell Color Change Macro not working after changing one word
    By jonesthemuso in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2019, 04:36 PM
  2. Macro to change cell text color based on darkness of cell fill color
    By cincyshirm61 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2014, 12:11 PM
  3. Replies: 4
    Last Post: 12-29-2013, 11:41 PM
  4. Cell background color (interior color) setting not working
    By Martin E. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2006, 02:10 PM
  5. Color text macro
    By mister z in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2005, 01:13 PM
  6. change text color based on adjacent cell text color
    By matthewst in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-01-2005, 03:49 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