If ActiveSheet.AutoFilterMode Then ActiveSheet.AutoFilterMode = False
Set rngRow = Range(Selection, Selection.Offset(0, 1))
If rngRow.Rows(rngRow.Row).SpecialCells(xlCellTypeVisible).Count - 1 = 1 Then
Do Until rngRow.Rows(rngRow.Row).SpecialCells(xlCellTypeVisible).Count - 1 = 1
Selection.Offset(1, 0).Select
Set rngRow = Range(Selection, Selection.Offset(0, 1))
Loop
Else
End If
Excel Workbook | |||
---|---|---|---|
A | |||
1 | 1 | ||
2 | 1 | ||
3 | 1 | ||
4 | 1 | ||
5 | 2 | ||
6 | 2 | ||
7 | 3 | ||
8 | 3 | ||
9 | 2 | ||
10 | 1 | ||
11 | 3 | ||
12 | 5 | ||
13 | 1 | ||
14 | 2 | ||
Sheet1 |
Excel Workbook | ||||
---|---|---|---|---|
A | B | |||
5 | 2 | This cell is filtered | ||
6 | 2 | This cell is filtered | ||
7 | 3 | This cell is filtered | ||
8 | 3 | This cell is filtered | ||
9 | 2 | This cell is filtered | ||
11 | 3 | This cell is filtered | ||
14 | 2 | This cell is filtered | ||
Excel 2010
|