Results 1 to 12 of 12

User Defined Function Fails when I run a Macro

Threaded View

  1. #1
    Registered User
    Join Date
    03-29-2016
    Location
    Los Angeles
    MS-Off Ver
    2016
    Posts
    12

    User Defined Function Fails when I run a Macro

    I have borrowed a UDF from another site. It has the simple function of finding the text color in a cell. It works perfectly when I use it as part of a formula. Here is the UDF:

    Function txtColor(rng As Range)
    txtColor = rng.Font.ColorIndex
    End Function
    I have a macro that filters cells based on the a formula using this UDF. When I filter using this formula by hand, the filter process works fine. But when I use my macro -- which filters, then copies, then pastes, the formula no longer works. All cells containing that formula transform into #VALUE!.

    Thank you in advance for any suggestions.

    Scott
    Last edited by scott altman; 09-11-2017 at 02:20 PM. Reason: Missing Code Tag

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] User-defined type not defined on Copy to Clipboard Macro
    By vamosj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2015, 11:31 AM
  2. A Macro to Apply the PROPER Function, whislt Excluding User Defined Words
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2015, 12:40 PM
  3. Macro will not allow conditional formatting with a user-defined function
    By Med_MV in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-16-2013, 05:28 PM
  4. user defined macro to replace certain characters in a string based on user input
    By whatappears in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2012, 06:25 PM
  5. Access connection works in Macro, not in user-defined Function
    By Steve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-27-2005, 10:05 AM
  6. How to: User Form to assign a user defined range to a macro variab
    By TrevTrav in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2005, 04:06 PM
  7. Macro user defined function row information
    By bj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2005, 11:06 AM

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