I am trying to make my work easier. I have an worksheet with a pivottable which get its data from a ms sql database (over 100000 records, if that counts). I need to autofilter this data. So I google for it.
I have found this vba code:
Private Sub Worksheet_Calculate()
Range("A11").CurrentRegion.AutoFilter field:=6, Criteria1:=Range("d5").Value
End Sub
I concluded that I can apply it to my case.
The range which I need to filter starts from A11, the filter should be applied to field no.6 by the value found in cell D5.
At first it does the filtering, but then I get this error:
Method 'Autofilter' of object 'Range' failed
I don't know what is wrong, excel gets stuck and nothing works
Maybe someone could give me a hint or something.
Thank you.