VBA AutoFilter and copy visible data

  • Hi, I'm using the below macro to open a file, filter column D to "Pps" and copy visible data to destination worksheet, after which i clear the filter (the coding works so far) then filter column D again, to "Pkt". however, the filter result returns empty instead.. Any idea what went wrong? Thanks in advance!



  • Re: VBA AutoFilter and copy visible data


    Hi chloe29,


    Welcome to the Ozgrid forum.


    Try removing the = sign from the filter criteria. At the moment it's expecting the = sign to be part of the string you are filtering on. E.g.:

    Code
    SourceSQ01FilterRng.AutoFilter Field:=4, Criteria1:="Pkt"


    Hope that helps.

    [COLOR="Purple"]Regards,[/COLOR]
    [COLOR="Purple"]Batman.[/COLOR]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!