Pessoal, estou utilizando o código abaixo para carregar dados numa combobox através da seleção de outro combobox!
Só que ele carrega os dados repetidos. Tem como deixar as informações exclusivas, sem repetir?
Vide código:
Private Sub Cmb_Comprador_Change()
        If Me.Cmb_Comprador.ListIndex < 0 Then
        Exit Sub
        Else
            Call CarregaMotivo(Me.Cmb_Comprador.List(Me.Cmb_Comprador.ListIndex))
        End If
    
End Sub
Private Sub CarregaMotivo(ByVal Categoria As String)
    Dim Linha As Integer, colunaMotivo As Integer, colunaComprador As Integer
    Linha = 2
    colunaMotivo = 6
    colunaComprador = 2
    Me.Cmb_Motivo.Clear
    With Sheets("_Bd_Pendentes")
        Do While Not IsEmpty(.Cells(Linha, colunaComprador))
            If .Cells(Linha, colunaComprador).Value = Categoria Then
                Me.Cmb_Motivo.AddItem .Cells(Linha, colunaMotivo).Value
            End If
            Linha = Linha + 1
        Loop
    End With
End Sub
Obrigado pela Força
                                                                                                	                                                
	                                         
                    
                    	
                            Postado : 07/09/2017 1:55 pm