+ Reply to Thread
Results 1 to 2 of 2

Calling a sub to autofilter and sort a table from within another sub

  1. #1
    Registered User
    Join Date
    02-05-2020
    Location
    UK
    MS-Off Ver
    2016
    Posts
    1

    Calling a sub to autofilter and sort a table from within another sub

    Hello

    I have created a sub to filter a table by one column, and sort alphabetically in ascending order by another column. This is what I've used:

    Please Login or Register  to view this content.
    When I step through this code it works fine; column B is filtered to show just #N/As and column C (FromName) is sorted alphabetically. However when I call this sub from within another sub it doesn't work properly. Column C gets sorted alphabetically and column B remains unfiltered, despite the filter drop down bar showing that it has been filtered to show just #N/As.

    The sub that contains this one (FilterSort) exports Outlook data, uses an INDEX MATCH formula to connect the data exported with a separate worksheet in the workbook, and then calls this sub to filter and sort that data, if that makes sense...

    Why would the sub work on it's own but not within another sub? If anyone could help or point me in the right direction I would appreciate greatly. Can also provide more info if anything is unclear. Thanks

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Calling a sub to autofilter and sort a table from within another sub

    Just a guess, do you have the screenupdating turned off and then forgot to turn it back on? Even if you have it, off, it should turn itself back on. If you have it, try removing it and see if that 'fixes' it.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

+ 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. Calling AutoFilter from Listbox
    By ABSTRAKTUS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2017, 07:01 AM
  2. [SOLVED] AutoFilter and Subtotal (differences in the result by calling the way)
    By kamijo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2016, 07:00 PM
  3. AutoFilter and Sort using VBA
    By jasoncw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2014, 05:26 PM
  4. calling cell number from header title and then applying autofilter
    By sameerk0286 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2010, 04:45 AM
  5. Sort of loop happening with calling macros
    By simonsmith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2008, 09:20 PM
  6. Capturing the Excel AutoFilter Sorting Event-sort and autofilter options
    By Kognyto in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2008, 05:36 PM
  7. Replies: 1
    Last Post: 02-16-2006, 08:25 AM

Tags for this Thread

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