NERI INACIO
29-03-2016 21:57:33
A minha Combo está procurando dados num limite de (acho) 1000 linhas. Como faço para aumentar isto, para que procure até o último lancamento?
Sub PreencherComboBox()
Dim n As Long, texto As Variant
Dim i As Integer
Me.cbofornec.Clear
For n = 1 To ListView1.ListItems.Count
If Me.ListView1.ListItems(n).ListSubItems(2) = "" Then Exit For
If InStr(texto, Me.ListView1.ListItems(n).ListSubItems(2)) = 0 Then
texto = texto & "|" & Me.ListView1.ListItems(n).ListSubItems(2) '& "|"
End If
Next
texto = Split(texto, "|")
For i = 1 To UBound(texto)
cbofornec.AddItem texto(i)
Next
Call OrdenarComboBox
End Sub
Sub PreencherComboBox()
Dim n As Long, texto As Variant
Dim i As Integer
Me.cbofornec.Clear
For n = 1 To ListView1.ListItems.Count
If Me.ListView1.ListItems(n).ListSubItems(2) = "" Then Exit For
If InStr(texto, Me.ListView1.ListItems(n).ListSubItems(2)) = 0 Then
texto = texto & "|" & Me.ListView1.ListItems(n).ListSubItems(2) '& "|"
End If
Next
texto = Split(texto, "|")
For i = 1 To UBound(texto)
cbofornec.AddItem texto(i)
Next
Call OrdenarComboBox
End Sub