Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Macros. Autofilter

Hello,

I would like to filter out some values using Macros.

Unfortunately, I only manage to create a filter in excel but no luck with selecting the data in specified column.

How could I achieve my goals?

XLDoc.Sheets(1).Range("A1").AutoFilter

Thank you!

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer
MVP
MVP

I think vbs goes straight through the order of parameters and didn't need / accept the parameter-names. I have now looked into a very old reporting of mine which worked at this time - here a snippet from them:

xlSheet.Activate

xlSheet.Cells(1, 1).Activate

xlSheet.Cells(1, 1).Autofilter 3, year(now() - 1)

xlSheet.Cells(1, 1).Autofilter 4, month(now() - 1)

xlSheet.Rows("2:" & xlZeile_1).Select

xlSheet.Rows("2:" & xlZeile_1).Delete

xlSheet.Cells(1, 1).Select

xlSheet.Cells(1, 1).Autofilter

- Marcus

View solution in original post

4 Replies
marcus_sommer
MVP
MVP

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

I've come across this site yesterday. Sadly, I've tried a lot of variations but with no result.

Screenshot_1.jpg

marcus_sommer
MVP
MVP

I think vbs goes straight through the order of parameters and didn't need / accept the parameter-names. I have now looked into a very old reporting of mine which worked at this time - here a snippet from them:

xlSheet.Activate

xlSheet.Cells(1, 1).Activate

xlSheet.Cells(1, 1).Autofilter 3, year(now() - 1)

xlSheet.Cells(1, 1).Autofilter 4, month(now() - 1)

xlSheet.Rows("2:" & xlZeile_1).Select

xlSheet.Rows("2:" & xlZeile_1).Delete

xlSheet.Cells(1, 1).Select

xlSheet.Cells(1, 1).Autofilter

- Marcus

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

I did manage to do this!

XLDoc.Sheets(1).Rows("1:1").AutoFilter 13, "<>0"

Thank you Marcus for your professional help!