How to get the range of the visible rows after applying an advanced filter in Excel (VBA)

前端 未结 3 1721
死守一世寂寞
死守一世寂寞 2020-12-01 16:20

Here is the code that applies an advanced filter to the column A on the Sheet1 worksheet (List range) by using the range of values on the Sheet2 (criteria range):

         


        
3条回答
  •  失恋的感觉
    2020-12-01 16:59

    You can use the following code to get the visible range of cells:

    Excel.Range visibleRange = Excel.Application.ActiveWindow.VisibleRange
    

    Hope this helps.

提交回复
热议问题