Prezados bom dia.
Tenho um filtro em listbox (filtro duplo) porém ele carrega os dados no listbox ate encontrar uma linha em branco.
Há possibilidade de modificar esse código para que ao chegar na linha em branco ele continue a procurar (filtrar) e carregue todos os dados?
Independente se tiver linhas em branco?
Desde já agradeço;
PS. Copiei esse codigo da net, e apenas adptei, por isso a dificuldade de modificar..rsr
Private Sub txt1_Change()
Dim guia As Worksheet
Dim valor_celula, linha, linhalistbox As Integer
Set guia = Plan1
linhalistbox = 0
linha = 2
ListBox4.Clear
With guia
While .Cells(linha, 2).Value <> Empty
valor_celula = .Cells(linha, 3).Value
If UCase(Left(valor_celula, Len(txt1.Text))) = UCase(txt1.Text) Then ' campus
valor_celula = .Cells(linha, 9).Value
If UCase(Left(valor_celula, Len(txt2.Text))) = UCase(txt2.Text) Then ' cpf
valor_celula = .Cells(linha, 39).Value
If UCase(Left(valor_celula, Len(txt3.Text))) = UCase(txt3.Text) Then ' data
valor_celula = .Cells(linha, 40).Value
If UCase(Left(valor_celula, Len(txt4.Text))) = UCase(txt4.Text) Then ' situacao
With ListBox4
.AddItem
.List(linhalistbox, 0) = guia.Cells(linha, 1)
.List(linhalistbox, 1) = guia.Cells(linha, 2)
.List(linhalistbox, 2) = guia.Cells(linha, 4)
.List(linhalistbox, 3) = guia.Cells(linha, 9)
.List(linhalistbox, 4) = guia.Cells(linha, 22)
.List(linhalistbox, 5) = guia.Cells(linha, 25)
.List(linhalistbox, 6) = guia.Cells(linha, 39)
.List(linhalistbox, 7) = guia.Cells(linha, 40)
.List(linhalistbox, 8) = guia.Cells(linha, 40)
End With
linhalistbox = linhalistbox + 1
End If
End If
End If
End If
linha = linha + 1
Wend
End With
End Sub