Select first visible cell directly beneath the header of a filtered column

前端 未结 4 1034
感情败类
感情败类 2020-12-06 19:34

I am trying to select the first visible cell directly beneath the header of a filtered column. The code I am getting is as below, but I have to problems with this code. Fi

4条回答
  •  借酒劲吻你
    2020-12-06 20:09

    Untested but:

    Sub Macro16()
    
        With ActiveSheet.Range("A1").CurrentRegion
            .AutoFilter field:=12, Criteria1:="Sheets"
            If .Columns(1).SpecialCells(xlCellTypeVisible).count > 1 Then
                With .Columns(10)
                    .Resize(.rows.count - 1).offset(1).SpecialCells(xlCellTypeVisible).FormulaR1C1 = "=RIGHT(RC[1],3)"
                End With
            End If
        End With
    
    End Sub
    

提交回复
热议问题