+ Reply to Thread
Results 1 to 2 of 2

Applying a Filter within a UDF without Affecting UDF's which Look at Same Data Set/Range

  1. #1
    Forum Contributor
    Join Date
    04-11-2017
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2010
    Posts
    110

    Applying a Filter within a UDF without Affecting UDF's which Look at Same Data Set/Range

    I have a UDF in sheet 2 which does calculations based on data in sheet 1.

    I have written a new UDF in sheet 3 which also looks at data in sheet 1. The issue I have is that the UDF in sheet 3 applies a filter to the data in sheet 1 which then causes in to essentially step in to the UDF's in sheet 2 as the filter has been applied to the same data set used in both functions.

    If I change the calculation option to 'manual' and step through the function in sheet 3, it works as it should however the above problem is causing it to produce erroneous results when the calc option is set to automatic (which is the option I need it to be on).

    Is there any way around this other than not using the filter within the function?

    Thanks in advance

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Applying a Filter within a UDF without Affecting UDF's which Look at Same Data Set/Ran

    A UDF cannot filter a sheet. This may be just semantics, but I don't think your code is technically a UDF. A UDF is a worksheet formula that uses a custom function created in VBA.

    It's hard to say how to fix it without seeing your code and how it works.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Applying a filter on the same Data in Multiple Sheets
    By lexskoza in forum Excel General
    Replies: 6
    Last Post: 03-07-2017, 09:34 AM
  2. [SOLVED] Applying Formula to different range of cells after Filter is applied
    By E5254730 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-19-2016, 09:59 AM
  3. Macro for applying filter for previous month's data
    By aaron1976 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-21-2015, 06:29 PM
  4. Replies: 4
    Last Post: 06-04-2013, 11:01 AM
  5. Replies: 3
    Last Post: 12-20-2012, 06:16 AM
  6. Separate data into another sheet applying Filter in a column
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2011, 03:57 PM
  7. Applying filter to original data from pivot table
    By Oingofan in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-10-2009, 02:30 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