ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CurrentPageList (https://www.excelbanter.com/excel-programming/437668-currentpagelist.html)

Joe[_51_]

CurrentPageList
 
I have a Page field and want to apply a filter to the field. For example if
the field has 3 values - A, B, and C. I want to set it to just display B.
How can I do this in VBA? I thought CurrentPageList was right but it doesn't
seem to work.

For this example say the page field is called Letters.

Thanks,
Joe



Colbert Zhou [MSFT]

CurrentPageList
 
Hello Joe,

We can call Range.AutoFilter function to filter a range of values. Codes
look like

ActiveSheet.Range("$A$1:$A$24").AutoFilter Field:=1, Criteria1:="B"

http://msdn.microsoft.com/en-us/library/bb242013.aspx
If you want only show "B", we just need to set the Criteria1 parameter to
"B"


Best regards,
Ji Zhou
Microsoft Online Community Support



All times are GMT +1. The time now is 07:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com