Te envío el código actualizado
Option Explicit
Dim h1, cargando
'
Private Sub cbusprv_Change()
'Por.Dante Amor
'Proveedor
finfprv.Visible = True
finfnueprv.Visible = False
finfprodprv.Visible = True
'
cargando = True
'
Cprodservprv.Clear
Cprodservprv = ""
Cprtnpnprv.Clear
Cprtnpnprv = ""
Crefpnprv.Clear
Crefpnprv = ""
Csrefpnprv.Clear
Csrefpnprv = ""
Ccolorpnprv.Clear
Ccolorpnprv = ""
'
If Cbusprv = "" Or Cbusprv.ListIndex = -1 Then
cargando = False
Exit Sub
End If
'
Dim i
For i = 11 To h1.Range("F" & Rows.Count).End(xlUp).Row
If h1.Cells(i, "F") = Cbusprv.Value Then
Call agregar(Cprodservprv, h1.Cells(i, "Q"))
End If
Next
Call Filtrar
cargando = False
End Sub
'
Private Sub Cprodservprv_Change()
'Producto
'
Cprtnpnprv.Clear
Cprtnpnprv = ""
Crefpnprv.Clear
Crefpnprv = ""
Csrefpnprv.Clear
Csrefpnprv = ""
Ccolorpnprv.Clear
Ccolorpnprv = ""
'
If Cprodservprv = "" Or Cprodservprv.ListIndex = -1 Then
cargando = False
Exit Sub
End If
If cargando Then Exit Sub
cargando = True
'
Dim i
For i = 11 To h1.Range("F" & Rows.Count).End(xlUp).Row
If h1.Cells(i, "F") = Cbusprv.Value And _
h1.Cells(i, "Q") = Cprodservprv Then
Call agregar(Cprtnpnprv, h1.Cells(i, "R"))
End If
Next
Call Filtrar
cargando = False
End Sub
'
Private Sub Cprtnpnprv_Change()
'Presentación
'
Crefpnprv.Clear
Crefpnprv = ""
Csrefpnprv.Clear
Csrefpnprv = ""
Ccolorpnprv.Clear
Ccolorpnprv = ""
'
If Cprtnpnprv = "" Or Cprtnpnprv.ListIndex = -1 Then
cargando = False
Exit Sub
End If
'
If cargando Then Exit Sub
cargando = True
Dim i
For i = 11 To h1.Range("F" & Rows.Count).End(xlUp).Row
If h1.Cells(i, "F") = Cbusprv.Value And _
h1.Cells(i, "Q") = Cprodservprv And _
h1.Cells(i, "R") = Cprtnpnprv Then
Call agregar(Crefpnprv, h1.Cells(i, "S"))
End If
Next
Call Filtrar
cargando = False
End Sub
Private Sub Crefpnprv_Change()
'Referencia
'
Csrefpnprv.Clear
Csrefpnprv = ""
Ccolorpnprv.Clear
Ccolorpnprv = ""
'
If Crefpnprv = "" Or Crefpnprv.ListIndex = -1 Then
cargando = False
Exit Sub
End If
'
If cargando Then Exit Sub
cargando = True
Dim i
For i = 11 To h1.Range("F" & Rows.Count).End(xlUp).Row
If h1.Cells(i, "F") = Cbusprv.Value And _
h1.Cells(i, "Q") = Cprodservprv And _
h1.Cells(i, "R") = Cprtnpnprv And _
h1.Cells(i, "S") = Crefpnprv Then
Call agregar(Csrefpnprv, h1.Cells(i, "T"))
End If
Next
Call Filtrar
cargando = False
End Sub
'
Private Sub Csrefpnprv_Change()
'SubReferencia
'
Ccolorpnprv.Clear
Ccolorpnprv = ""
'
If Csrefpnprv = "" Or Csrefpnprv.ListIndex = -1 Then
cargando = False
Exit Sub
End If
'
If cargando Then Exit Sub
cargando = True
Dim i
For i = 11 To h1.Range("F" & Rows.Count).End(xlUp).Row
If h1.Cells(i, "F") = Cbusprv.Value And _
h1.Cells(i, "Q") = Cprodservprv And _
h1.Cells(i, "R") = Cprtnpnprv And _
h1.Cells(i, "S") = Crefpnprv And _
h1.Cells(i, "T") = Csrefpnprv Then
Call agregar(Ccolorpnprv, h1.Cells(i, "U"))
End If
Next
Call Filtrar
cargando = False
End Sub
'
Sub Filtrar()
'Por.Dante Amor
fprodprv.Visible = True
lprodprv.Clear
Dim i, d1, d2, d3, d4, d5, d6
d1 = Cbusprv
For i = 11 To h1.Range("F" & Rows.Count).End(xlUp).Row
If Cprodservprv = "" Then d2 = h1.Cells(i, "Q") Else d2 = Cprodservprv
If Cprtnpnprv = "" Then d3 = h1.Cells(i, "R") Else d3 = Cprtnpnprv
If Crefpnprv = "" Then d4 = h1.Cells(i, "S") Else d4 = Crefpnprv
If Csrefpnprv = "" Then d5 = h1.Cells(i, "T") Else d5 = Csrefpnprv
If Ccolorpnprv = "" Then d6 = h1.Cells(i, "U") Else d6 = Ccolorpnprv
'Si el dato de la fila coincide con textbox carga los datos al listbox
If h1.Cells(i, "F") = d1 And h1.Cells(i, "Q") = d2 And _
h1.Cells(i, "R") = d3 And h1.Cells(i, "S") = d4 And _
h1.Cells(i, "T") = d5 And h1.Cells(i, "U") = d6 Then
'Copia los datos de la celda list box
lprodprv.AddItem
lprodprv.List(lprodprv.ListCount - 1, 0) = h1.Cells(i, "Q")
lprodprv.List(lprodprv.ListCount - 1, 1) = h1.Cells(i, "R")
lprodprv.List(lprodprv.ListCount - 1, 2) = h1.Cells(i, "S")
lprodprv.List(lprodprv.ListCount - 1, 3) = h1.Cells(i, "T")
lprodprv.List(lprodprv.ListCount - 1, 4) = h1.Cells(i, "U")
lprodprv.List(lprodprv.ListCount - 1, 5) = h1.Cells(i, "V")
lprodprv.List(lprodprv.ListCount - 1, 6) = h1.Cells(i, "W")
lprodprv.List(lprodprv.ListCount - 1, 7) = h1.Cells(i, "X")
lprodprv.List(lprodprv.ListCount - 1, 8) = h1.Cells(i, "Y")
lprodprv.List(lprodprv.ListCount - 1, 9) = h1.Cells(i, "AC")
End If
Next
End Sub
'
Private Sub bnueprv_Click()
finfnueprv.Visible = True
finfprv.Visible = False
End Sub
'
Private Sub twhatspvrn_Change()
finfprodprv.Visible = True
End Sub
Private Sub UserForm_Initialize()
tlogprv.SetFocus
'finfprodprv.Visible = True
'
'Carga proveedores
Dim i
Set h1 = Sheets("prv")
For i = 11 To h1.Range("F" & Rows.Count).End(xlUp).Row
Call agregar(Cbusprv, h1.Cells(i, "F"))
Next
cargando = False
End Sub
'
Sub agregar(combo As ComboBox, dato As String)
'por.DAM agrega los item únicos y en orden alfabético
Dim i
For i = 0 To combo.ListCount - 1
Select Case StrComp(combo.List(i), dato, vbTextCompare)
Case 0: Exit Sub 'ya existe en el combo y ya no lo agrega
Case 1: combo.AddItem dato, i: Exit Sub 'Es menor, lo agrega antes del comparado
End Select
Next
combo.AddItem dato 'Es mayor lo agrega al final
End Sub
'
Private Sub tlogprv_Change()
If tlogprv = "8" Then
fbusprv.Visible = True
tlogprv.Visible = False
Labelloginprv.Visible = False
End If
End Sub
.
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias
.
Avísame cualquier duda
.