Excel Advanced Filter Unique Values on a Filtered List - Multiple Criteria

北城余情 提交于 2020-01-06 19:57:26

问题


I am trying to use the Advanced Filter in Excel Unique Values in VBA on an already filter list, but the results I am seeing is not as expected. The problem I have is that the advanced filter for unique values is running over a list of rows that have already been filtered, and when the advanced filter is running it add values that have already been filtered out. To described the problem I have already filtered out non null dates, and another column that contains "-". However, when I apply the unique values filter on column it adds in null dates and other values from the other column.

Is there away to apply the advanced filter for unique values on an already filtered list so it does not add in rows that shouldn't be there?


回答1:


You may no longe need this but here goes. If your trying to copy the unique values from a filtered worksheet, first SET a range to the visible cells in the usedrange of the worksheet in question. for instance SET myrange = thisworksheet.usedrange.SpecialCells(xlCellTypeVisible). then do your unique filter thing against this range. Not enough information (what are you doing with the result) to help more. This is based on a the worksheet having a list that has you have used an advance filter against. If you are using a standard filter, this will not work.



来源:https://stackoverflow.com/questions/10663846/excel-advanced-filter-unique-values-on-a-filtered-list-multiple-criteria

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!