Private Sub ComboBox1_Change()
If Me.ComboBox1.ListIndex >= 0 Then
ListBox1.ColumnCount = 8
'ListBox1.RowSource = ComboBox1.Value & "!A2:H" & Sheets(ComboBox1.Value).Cells(Rows.Count, 1).End(xlUp).Row
Dim REGISTROS(1 To 1000, 1 To 8) As String
Dim LINHA As Long
Dim LINHA2 As Long
Dim R As Integer
LINHA2 = 1
For LINHA = 2 To Sheets(ComboBox1.Value).Cells(Rows.Count, 1).End(xlUp).Row
If UCase(CStr(Sheets(ComboBox1.Value).Cells(LINHA, "E").Value)) <> "SIM" Then
For R = 1 To 8
REGISTROS(LINHA2, R) = CStr(Sheets(ComboBox1.Value).Cells(LINHA, R).Value)
Next R
LINHA2 = LINHA2 + 1
End If
Next LINHA
ListBox1.List = REGISTROS
'Call pesquisanome211
End If
'TextBox1.SetFocus
End Sub
Postado : 28/01/2018 4:38 pm