Cargar List Box según datos de dos combo box Excel

Le adjunto le detalle la siguiente interrogante.

Cargar List box con según datos de dos combo box

En el formulario al seleccionar el estado "PENDIENTE" y luego "cargar numero de pedido" que en List box solo de muestren los pendientes o caso contrario si en el estado selecciono "IMPRESO" al cargar el numero de pedido que en el List box se muestre los "IMPRESO"

Gracias por la atención prestada

Slds

Robert

1 respuesta

Respuesta
2

Te anexo la macro

Private Sub ComboBox1_Change()
'Por.Dante amor
    If ComboBox4 = "" Then
        MsgBox "Debes seleccionar un estado"
        ComboBox4.SetFocus
        Exit Sub
    End If
    '
    ListBox1.Clear
    TextBox10 = ""
    If ComboBox1 = "" Then Exit Sub
    '
    Set h = Sheets("bd_guias")
    For i = 7 To h.Range("I" & Rows.Count).End(xlUp).Row
        If h.Cells(i, "I") = ComboBox1 And h.Cells(i, "N") = ComboBox4 Then
            TextBox1 = h.Cells(i, "A")
            TextBox2 = h.Cells(i, "F")
            DTPicker1 = h.Cells(i, "H")
            ListBox1. AddItem
            ListBox1. List(ListBox1.ListCount - 1, 0) = h.Cells(i, 2)
            ListBox1. List(ListBox1.ListCount - 1, 1) = h.Cells(i, 3)
            ListBox1. List(ListBox1.ListCount - 1, 2) = h.Cells(i, 4)
            ListBox1. List(ListBox1.ListCount - 1, 3) = h.Cells(i, 5)
            ListBox1. List(ListBox1.ListCount - 1, 4) = h. Cells(i, 14)
            TextBox10 = Val(TextBox10) + 1
        End If
    Next
End Sub
‘
F E L I Z A Ñ O T E D E S E A D a n t e A m o r. Recuerda valorar la respuesta. G r a c i a s
:) 

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas