• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need VBA Code for Advanced Filter

vijay.vizzu

Member
Hi All....


Sorry for long absence, i was suffered with hepatitis, come to the point, i need a vba code which can update the data with advanced filter. I have one sheet namely DPS, and with advanced filter i want to extract some data from DPS sheet and paste it in a new sheet namely sheet1. I have applied advanced filter, it works fine. i have created two range names, fltRange and fltCriteria. In advanced it works fine, but when i am changing some criteria's in fltCriteria, i need to delete all the previous filtered records and again need to do the same process again. So now i want to put a vba code with a button, to do my requirement.


So please post a vba code to do this.


one more thing, if i want to use blank in filter area, what should i do


Any help highly appreicated
 
Hi Vijay,


It would be great if you could please upload a sample file in order to help others to construct the code by looking at your data layout.


It's wonderful to know that you have recovered from the disease...Take care..


Looking forward to your sample file.


Kaushik
 
Hi Kaushik,


Thank you so much for reply, yes now i feeling better but still some tests are going. But i am very sorry to say this, in my office i can't able to upload the file becoz some server restrictions.


Very sorry.


Regards

Vijay
 
Hi Vijay,

Welcome Back..

i need to delete all the previous filtered records

Code:
If Sheet1.AutoFilterMode = True Then Sheet1.AutoFilterMode = False


Just add this line above the line, where you have started AutoFilter..


Regards,

Deb..


PS: I hope Delete all the Previous record doesn't means "Delete" Records, It is "Remove" AutoFilter..


PPS: Please dont say.. "Delete" & "Remove" 's meaning are same in Dictionary :)
 
Back
Top