Manual filter via VBA with the latest values available

1

I need to filter, via VBA, the last 30 values available in a dynamic table but in the "manual filter" which is the line ... Is it possible to read the values in the "manual filter" in VB?

    
asked by anonymous 25.03.2015 / 19:46

1 answer

0

Abnerka,

Below is an example of VBA code that allows you to differentiate hidden cells from visible cells. Hidden cells get the value of RowHeight = 0 in Excel.

Const _
    primeiraLinha = 4, _
    ultimalinha = 12, _
    colunaPrincipal = "A", _
    tudo = colunaPrincipal & primeiraLinha & ":" & colunaPrincipal & ultimalinha
    nomeAbaExcel = "Plan1"

Dim objetoLinha As Object
For Each objetoLinha In ThisWorkbook.Sheets(nomeAbaExcel).Range(tudo).Cells

    If objetoLinha.RowHeight > 0 Then

        Total = Total + 1

    End If

Next objetoLinha

MsgBox Total

In fact I admit that I do not quite understand what you really need. But I believe that with this code you can adapt and solve the problem.

For all cases, the PivotTable provides the ability to filter the 30 largest and 30 smallest items (if it helps).

    
26.03.2015 / 19:26