+ Reply to Thread
Results 1 to 9 of 9

autofilter issue

  1. #1
    Registered User
    Join Date
    08-20-2009
    Location
    UK
    MS-Off Ver
    Excel 2002
    Posts
    8

    autofilter issue

    Hello,

    I am using the following vba to filter some data. Now this code correctly applies the criteria, but does not appear to correctly apply the filter.

    Please Login or Register  to view this content.
    When i click the dropdown and select Date Filters > Customer Filter. the correct criteria is added. Now if I hit OK at this point the sheet refreshes and the filter works, but initially it doesn't.

    Im thinking I'm missing a very simple step here, but I just can't spot it.

    Cheers for any help

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: autofilter issue

    If the finalrow is probably defined and assigned a value.

    Please Login or Register  to view this content.
    Best to attach a sample book you are working on.

  3. #3
    Registered User
    Join Date
    08-20-2009
    Location
    UK
    MS-Off Ver
    Excel 2002
    Posts
    8

    Re: autofilter issue

    Sorry thats a mistake in my variable names

    it should probably read as FinalColumn and RowCount

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: autofilter issue

    What are FinalColumn and RowCount?

    If they are variable, Where are declared and assigned values?


    May try one of these lines

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-20-2009
    Location
    UK
    MS-Off Ver
    Excel 2002
    Posts
    8

    Re: autofilter issue

    They are declared I just didn't list them in this snippet. I dont think thats the issue I'm having as the range is being correctly defined.

    Please Login or Register  to view this content.
    But I'm still having the issue where the correct criteria are added into the custom filter box but the spreadsheet does not reflect the filter until i open the box and hit OK

    snip.JPG

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: autofilter issue

    As I said, it would have easier to resolve the issue you have if you had attached the sample.
    We will go around the circle.
    My guess is you have recorded a macro to filter a data and it works, but when you try to tweak to adjust the rows and columns, you get an error. Is this right?

  7. #7
    Registered User
    Join Date
    08-20-2009
    Location
    UK
    MS-Off Ver
    Excel 2002
    Posts
    8

    Re: autofilter issue

    I don't get an error as such, as I said it inserts all the correct criteria and the code fully executes but the data just isnt correctly filtered until i open the custom filter dialog box and hit OK

    But yes, If I enter all the criteria manually it does work.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: autofilter issue

    This is correct code for me.

    Filtering with date is very quirky. You have defined your data as string, but the dates in column 32 might be numbers( Actual dates) or the other way round.

    Please Login or Register  to view this content.
    Last edited by AB33; 07-01-2016 at 06:04 AM.

  9. #9
    Registered User
    Join Date
    08-20-2009
    Location
    UK
    MS-Off Ver
    Excel 2002
    Posts
    8

    Re: autofilter issue

    Thanks for your help.

    I think it was because I was inserting an extra space at the end of the range with & ""

    Please Login or Register  to view this content.
    Seems to be working now......

+ 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. Issue with autofilter
    By kokapelly in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-05-2014, 03:14 PM
  2. [SOLVED] VBA Issue with Autofilter and Date.
    By Jyae in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-28-2013, 08:59 AM
  3. Autofilter date issue
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2013, 09:55 AM
  4. VBA AutoFilter issue
    By rowee21 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-11-2012, 10:29 AM
  5. AutoFilter Speed Issue
    By rohansshetty7 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2009, 01:50 AM
  6. AutoFilter Issue
    By ilee10 in forum Excel General
    Replies: 3
    Last Post: 11-28-2008, 06:28 AM
  7. AutoFilter Issue
    By Kumarrrr in forum Excel General
    Replies: 1
    Last Post: 04-16-2008, 11:16 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