+ Reply to Thread
Results 1 to 3 of 3

VBA: Creating a UDF that automatically updates as the data changes.

  1. #1
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    VBA: Creating a UDF that automatically updates as the data changes.

    I just wrote a UDF to sum up a range based on whether or not the background is colored. I don't know if the UDF itself is written efficiently or not, but it seems to work. The code is as follows (there are two arguments; one is the range being summed, the other is a boolean. If TRUE, the UDF sums colored cells, if FALSE it sums non colored cells):

    Please Login or Register  to view this content.
    The problem I have is that when I use the formula in the spreadsheet, it doesn't update when I color new cells. It also doesn't update if I press F9. The only way to have it change is by physically double clicking in the cell, and pressing enter (basically reentering the formula). Is there anyway around this?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You can press Ctrl+Alt+F9 to force recalculation.

  3. #3
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    That worked. Thanks for the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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