简体   繁体   中英

Excel VBA - Select first cell in filtered listobject data

I want my macro to select or goto the first row of filtered data in a listobject . I am trying this code but I get an error.

activesheet.AutoFilter.Range.offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 2).select

I would like to do this because if the user filters the data, whilst he has scrolled mid-way through the sheet, then he might not see all of the filtered data because of the freezed panes.

ok I figured this out:

Application.Goto lo_f.DataBodyRange.SpecialCells(xlCellTypeVisible).Cells(1), True

Need to use Goto in order to bring the screen to the filtered cell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM