+ Reply to Thread
Results 1 to 8 of 8

Activate a function

  1. #1
    Forum Contributor
    Join Date
    10-17-2018
    Location
    Knoxville, TN
    MS-Off Ver
    Office 365
    Posts
    214

    Activate a function

    I have finally got a function that counts the number of cells with a "red" font. How do you activate it to update the number when another cell has been enter with a red font? The name is "CountFontColor" and a macro button won't pick it so. Maybe a button click?

    Thanks

    Jerry

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,943

    Re: Activate a function

    So is this a VBA query?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    10-17-2018
    Location
    Knoxville, TN
    MS-Off Ver
    Office 365
    Posts
    214

    Re: Activate a function

    Sorry, was intended to be in Formulas and Functions. Would you be so kind to place it where it goes?

    Jerry

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,943

    Re: Activate a function

    I don't think so. If you are wanting to use a command button for what looks like a UDF (user defined function), then it's a VBA query. I am moving your thread there now.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Activate a function

    Assuming this is a VBA procedure that you are calling from a spreadsheet cell like =CountFontColor(range), then I would suggest you make the function volatile by adding Application.Volatile to the function https://docs.microsoft.com/en-us/off...ation.Volatile This will make the function volatile that it calculates with every calculate event.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Activate a function

    You should note however that changing the formatting of a cell will not trigger a recalculation on its own.
    Rory

  7. #7
    Forum Contributor
    Join Date
    10-17-2018
    Location
    Knoxville, TN
    MS-Off Ver
    Office 365
    Posts
    214

    Re: Activate a function

    McShorty, thanks for that info but I have discovered another problem. Since the red fonts are not manually entered, but thru CF and it looks like CF owns the rules when it comes to formatting and the function won't count those cells that were CF'd. Attached is an example with conditional formatting. Take a look and see if CF can be included.
    Attached Files Attached Files
    Last edited by jevicha2; 10-04-2021 at 10:31 AM.

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Activate a function

    You'd be better off using COUNTIFS and replicating whatever criteria were used to colour the cells in the first place.

+ 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. Activate excel Function
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2014, 09:12 PM
  2. [SOLVED] Need help with windows().activate or code with similar function
    By mfitzgerald94 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-02-2013, 08:15 PM
  3. Is there a way of using colour/color fill to activate a function?
    By tasmith7482 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-12-2013, 03:44 PM
  4. how to activate the function/formula in subsequent cell
    By jbshew in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 12-26-2012, 02:58 AM
  5. Replies: 3
    Last Post: 10-10-2012, 05:10 PM
  6. A macro to activate function in VBA
    By unley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2011, 06:53 PM
  7. [SOLVED] How to Activate Vlookup Function?
    By ViestaWu in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-10-2006, 06:14 PM
  8. [SOLVED] Activate a Worksheet from a Custom Function ??
    By monir in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-17-2005, 02:06 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