+ Reply to Thread
Results 1 to 3 of 3

VBA autofilter not picking up the correct wanted information

  1. #1
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    VBA autofilter not picking up the correct wanted information

    Hi all
    If anyone can help me with this I would be extremely gratefully as its driving me nuts. I have a autofilter code that picks up certain range in order to be delete these rows. My problem is that for some reason its not picking up all all the rows that it should. I think must be a problem with the data itself as I have used loads of autofilters before and they have all worked just fine. If it is because of the data I need to figure out how to correct it.
    Current code:


    Please Login or Register  to view this content.
    Note that I have purpously blocked off part of the code that would delete the visible rows.

    I have attached xls with the problem.
    If you run macro you can see it onlt picks up rows with values:
    07/06/2011
    06/06/2011

    Now if you will go and click on the filter, click custom and click ok (dont even change the parameters) then now you will see the following rows
    24/06/2011
    23/06/2011
    22/06/2011
    21/06/2011
    07/06/2011
    06/06/2011

    This is what it should pick up and its not doing it via macro. Im really near finishing some awesome macros and this a part that is stopping me to do it. Can someone help me to figure out what is going wrong. Im going to my holiday quite soon and I would like to get it right before I do that so my colleague can do my account while I will be away.


    Any help would be very appreciated.
    Cheers
    Rain
    Attached Files Attached Files
    Last edited by rain4u; 06-30-2011 at 12:32 PM.

  2. #2
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: VBA autofilter not picking up the correct wanted information

    i guess the problem is in the date format, try this for criteria2
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Re: VBA autofilter not picking up the correct wanted information

    Hi. You are right. Well spotted it gets the format wrong for one of the criteria. Even though in my proper macros they are dynamic not fixed static dates, i was able to rectify it.
    Cheers


    Rain

+ 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