Manual filter via VBA with last available values

Asked

Viewed 527 times

1

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

  • Hey friend, can you be clearer in your question? Excel use 12 years and do not know exactly what it is "manual filter".

  • These are the line filters and not the dynamic table filters themselves..

1 answer

0


Abnerka,

Below example of VBA code that allows you to differentiate hidden cells from visible cells. Hidden cells get 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 I don’t quite understand what you really need. But I believe with this code you can adapt and solve the problem.

For all cases, the dynamic table provides the possibility to filter the 30 largest and 30 smallest items (if help).

inserir a descrição da imagem aqui

  • Monday I’ll try, thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.