H o l a:
Te anexo el código:
Private Sub ComboBox2_Change() 'cambia combo grado
Call FiltarGradoSeccion
End Sub
Private Sub ComboBox3_Change() 'cambia combo seccion
Call FiltarGradoSeccion
End Sub
Sub FiltarGradoSeccion()
'Por.Dante Amor
Set h5 = Sheets("Padres")
Set h6 = Sheets("Hijos")
Listbox1.Clear
For i = 4 To h5.Range("C" & Rows.Count).End(xlUp).Row
dni = h5.Cells(i, "A")
For j = 4 To h6.Range("A" & Rows.Count).End(xlUp).Row
If IsNumeric(ComboBox2) Then grado = Val(ComboBox2) Else grado = ComboBox2
secc = ComboBox3
If grado = "" Then grado = h6.Cells(j, "C")
If secc = "" Then secc = h6.Cells(j, "D")
If h6.Cells(j, "A") = dni And h6.Cells(j, "C") = grado And _
h6.Cells(j, "D") = secc Then
With Listbox1
. AddItem h5.Cells(i, "A")
. List(.ListCount - 1, 1) = h5.Cells(i, "B")
. List(.ListCount - 1, 2) = h5.Cells(i, "C")
. List(.ListCount - 1, 3) = h5.Cells(i, "D")
. List(.ListCount - 1, 4) = h5.Cells(i, "E")
End With
Exit For
End If
Next
Next
End Sub
' : )
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias
' : )