-1
You can help me, I’m trying to make mine listbox
load the spreadsheet 3, but he carries only the first line
Sub Filtro()
Dim linha, linhalistbox As Integer
Dim valor_celula As String
linhalistbox = 0
linha = 1
Planilha3.Select
With Planilha3
While .Cells(linha, 9).Value <> ""
valor_celula = .Cells(linha, 5).Value
If UCase(Left(valor_celula, Len(txt_referencia.Text))) = UCase(txt_referencia.Text) Then
valor_celula = .Cells(linha, 6).Value
If UCase(Left(valor_celula, Len(txt_tamanho.Text))) = UCase(txt_tamanho.Text) Then
Me.ListBox1.ColumnWidths = "60;100;40;50;50;40;40;60;60"
With ListBox1
.AddItem
.List(linhalistbox, 0) = Planilha3.Cells(linha, 1)
.List(linhalistbox, 1) = Planilha3.Cells(linha, 2)
.List(linhalistbox, 2) = Planilha3.Cells(linha, 3)
.List(linhalistbox, 3) = Planilha3.Cells(linha, 4)
.List(linhalistbox, 4) = Planilha3.Cells(linha, 5)
.List(linhalistbox, 5) = Planilha3.Cells(linha, 6)
.List(linhalistbox, 6) = Planilha3.Cells(linha, 7)
.List(linhalistbox, 7) = Planilha3.Cells(linha, 8)
.List(linhalistbox, 8) = Planilha3.Cells(linha, 9)
End With
linhalistbox = linhalistbox + 1
End If
End If
linha = linha + 1
Wend
End With
End Sub
Private Sub txt_referencia_Change()
Call Filtro
End Sub
Private Sub UserForm_Click()
Call Filtro
End Sub
Private Sub UserForm_Initialize()
Call Filtro
End Sub
What I saw was missing a loop that makes that after loading the first line it remakes the operation you can use for next or until
– PAULO CLEIR CASSIO SILVA DE SO