VBA - How to select autofilter range in an yet unnamed workbook?

  • Thread starter Thread starter Frank Krogh
  • Start date Start date
F

Frank Krogh

I try to select an autofilter range in a yet unnamed workbook (BookX):

If Not Selection.AutoFilter Then Selection.AutoFilter
Workbooks(Workbooks.Count).Activate
Workbooks(Workbooks.Count).Application.AutoFilter.Range.Select


Why do I receive the error message 438 "Object doesn't support this property
or method"


Thanks for suggestions


Frank Krogh
 
Sorry, this seems to works better :-)

If Not Selection.AutoFilter Then Selection.AutoFilter
With ActiveSheet
.AutoFilter.Range.Select
End With
 
Workbooks(Workbooks.Count).Activate
If Not ActiveSheet.AutoFilterMode Then Selection.AutoFilter
Activesheet.AutoFilter.Range.Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top