Filtrar varias más de 3 columnas en excel y Vba

Disculpa tengo bastantes dudas sobre un programa que estoy realizando, te podía mandar el código para que me ayudes, tengo demasiada información y no logro acomodar en un form.

1 respuesta

Respuesta
1

H o l a : Envíame tu información y me explicas con ejemplos lo que necesitas.

Mi correo [email protected]

En el asunto del correo escribe tu nombre de usuario “Selene Hdez” y el título de esta pregunta.

¡Gracias! 

Ya te mande el correo :)

Hola, ¿pudo revisar la información? Tal vez no me explique bien, gracias!

H o l a : Te anexo el código para filtrar por fecha y por cliente

Dim h1, h2
Private Sub cmbPrintingService_Change()
'Act.Por.Dante Amor
    ComboBox1 = ""
    ComboBox1.Clear
    If cmbPrintingService.ListIndex = -1 Or cmbPrintingService = "" Then
        Exit Sub
    End If
    h2.Cells.Clear
    u = h1.Range("A" & Rows.Count).End(xlUp).Row
    h1.Range("$A$1:$AH$" & u).AutoFilter Field:=9, Criteria1:=cmbPrintingService
    u = h1.Range("A" & Rows.Count).End(xlUp).Row
    h1.Range("A1:A" & u).Copy h2.Range("A1")
    u = h2.Range("A" & Rows.Count).End(xlUp).Row
    h2.Range("A1:A" & u).RemoveDuplicates Columns:=1, Header:=xlYes
    h1.ShowAllData
    '
    u = h2.Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To u
        ComboBox1.AddItem h2.Cells(i, "A")
    Next
End Sub
'
Private Sub cmdSalir_Click()
   Unload Me
End Sub
Private Sub ComboBox1_Change()
'Por.Dante Amor
    txtIncont = ""
    txtFincont = ""
    txtCant = ""
    txtEquipo = ""
    txtTecno = ""
    txtNs = ""
    txtVprev = ""
    txtUbicacion = ""
    '
    If ComboBox1.ListIndex = -1 Or ComboBox1 = "" Then
        Exit Sub
    End If
    Set b = h1.Columns("A").Find(ComboBox1, lookat:=xlWhole)
    If Not b Is Nothing Then
        txtIncont = h1.Range("B" & b.Row).Value
        txtFincont = h1.Range("C" & b.Row).Value
        txtCant = h1.Range("D" & b.Row).Value
        txtEquipo = h1.Range("E" & b.Row).Value
        txtTecno = h1.Range("F" & b.Row).Value
        txtNs = h1.Range("G" & b.Row).Value
        txtVprev = h1.Range("H" & b.Row).Value
        txtUbicacion = h1.Range("AH" & b.Row).Value
    End If
End Sub
'
Private Sub CommandButton1_Click()
'Act.Por.Dante Amor
    If ComboBox1.ListIndex = -1 Or ComboBox1 = "" Then
        MsgBox "Seleciona un cliente"
        Exit Sub
    End If
    If cmbPrintingService.ListIndex = -1 Or cmbPrintingService = "" Then
        MsgBox "Selecciona una Fecha de Preventivo"
        Exit Sub
    End If
    usfMarcasyModelos.Hide
    NumSerie.Show
End Sub
'
Private Sub UserForm_Initialize()
'Por.Dante Amor
    Set h1 = Hoja3
    Set h2 = Sheets("temp")
    h2.Cells.Clear
    On Error Resume Next
    h1.ShowAllData
    On Error GoTo 0
    u = h1.Range("A" & Rows.Count).End(xlUp).Row
    h1.Range("I1:I" & u).Copy h2.Range("A1")
    h2.Range("A1:A" & u).RemoveDuplicates Columns:=1, Header:=xlYes
    u = h2.Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To u
        cmbPrintingService.AddItem h2.Cells(i, "A")
    Next
End Sub
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas