分类汇总

用于筛选后方便进行复杂粘贴。

Sub 选定可见行()
    Dim rng As Range
    Set rng = Selection
 
    If Not rng Is Nothing Then
        On Error Resume Next
        ' 仅选定可见的单元格
        rng.SpecialCells(xlCellTypeVisible).Select
        On Error GoTo 0
    End If
End Sub