+ Reply to Thread
Results 1 to 7 of 7

Conditional formatting UDF value error

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Conditional formatting UDF value error

    Hello everyone
    I have UDF function that enables me to count colored cells (conditional formatting cells) and sum the values of colored cells
    Please Login or Register  to view this content.
    I need to update results of the UDF .. as I noticed the following ..if I select any cell withing A1:B15 which has conditional formatting rules, the results give a value error ..but when selecting any other cell , everything goes right..
    Can I fix this debug?
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Conditional formatting UDF value error

    Maybe this.
    Here's the formula I used in cell G3 of your sample sheet.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,303

    Re: Conditional formatting UDF value error

    Actually, the problem occurs if you select a cell anywhere in column A or column B.

    A workaround is to add this near the start of your code:

    Please Login or Register  to view this content.

    It doesn't make the problem go away ... but you could change the error message to say "don't select this cell!"

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Conditional formatting UDF value error

    See next code
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Conditional formatting UDF value error

    Thanks Mr. Bruce for nice formula
    In fact I know that I can achieve counting using Countif function ..but in original file the issue is very complicated so I use this UDF function

    Thank you very much Mr. TMS for this addition to code but I need to deal with the UDF in normal way
    That's I need to select any cell in any column without that error ..Just to display or update the results at once

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Conditional formatting UDF value error

    Mr. PCI
    That's awesome .. really fascinating
    Exactly as needed
    Thank you very much for great help

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Conditional formatting UDF value error

    YasserKhalil you are welcome
    It was a pleasure, to understand the issue and to prepare the update

+ 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. Conditional Formatting - Run Time Error '13' Type Mismatch Error
    By ksp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2011, 07:37 PM
  2. [SOLVED] Conditional formatting error
    By graeme.hilton@gmail.com in forum Excel General
    Replies: 4
    Last Post: 05-22-2006, 10:25 AM
  3. Conditional Formatting error
    By Nikki in forum Excel General
    Replies: 1
    Last Post: 03-10-2006, 07:35 AM
  4. conditional formatting for Error
    By krupesh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  5. conditional formatting for Error
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 02:05 PM
  6. [SOLVED] conditional formatting for Error
    By krupesh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  7. [SOLVED] conditional formatting for Error
    By krupesh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  8. conditional formatting for Error
    By krupesh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2005, 02: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