Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dos filtros a la vez

publicado

Buenas tardes estimados amigos, tengo un problema que aun no puedo resolver, he estado intentando hacerlo ya hace varios días y aun no lo consigo, les explico de que se trata, tengo un formulario en el cual tengo que filtrar datos mediante dos combobox uno de meses y otro de docentes, por ejemplo si selecciono el mes de Marzo, que me filtre todos los datos que tienen esa fecha y al mismo tiempo si quiero saber si el docente tiene registro em ese mes que lo muestre, y todo que lo filtre dentro de un listbox, adjunto el archivo, espero que me ayuden por favor 

Libro1.xlsm

Featured Replies

publicado
  • Autor

Si muchas gracias

publicado
  • Autor

Una consulta mas no se si podría vincular todos los filtros por ejemplo tengo un filtro que es por fecha(00/00/0000 )pero no me muestra la hora, y pues deseo vincular con los filtros de Meses y de Docentes

Private Sub Buscar()
With Sheets("Primaria")
   Me.ListTabla.RowSource = ""
   If CbxMeses = "" And CbxDocentes = "" Then
      ListTabla.List = Sheets("Primaria").ListObjects("Primaria").DataBodyRange.Value
      Exit Sub
   End If
   For X = 2 To .Range("A" & Rows.Count).End(xlUp).Row
      ok = False
      If CbxMeses.ListIndex = -1 Then
         If CbxMeses = "" Then
            ok = True
         End If
      Else
         Mes = Split(Range("E" & X).Text, "/")(0)
         If CStr(CbxMeses.ListIndex + 3) = Mes Then
            ok = True
         End If
      End If
      If ok = True Then
         If CbxDocentes = .Range("C" & X) Or _
            CbxDocentes = "" Then
            ListTabla.AddItem .Range("A" & X)
            ListTabla.List(ListTabla.ListCount - 1, 1) = .Range("B" & X)
            ListTabla.List(ListTabla.ListCount - 1, 2) = .Range("C" & X)
            ListTabla.List(ListTabla.ListCount - 1, 3) = .Range("D" & X)
            ListTabla.List(ListTabla.ListCount - 1, 4) = .Range("E" & X)
         End If
      End If
   Next
End With
End Sub


Private Sub btnFecha_Click(): Calendario.Show: End Sub


Private Sub CbxDocentes_Change()
Buscar
End Sub

Private Sub CbxMeses_Change()
Buscar
End Sub

Private Sub Label1_Click()

End Sub

Private Sub txtFecha_Change()

    With Hoja5.Range("A1").CurrentRegion
        uf = .Range("A" & Rows.Count).End(xlUp).Row
        .Columns("E:E").NumberFormat = "m/d/yyyy"
        .AutoFilter 5, txtFecha.Value
        Hoja1.Range("A1").CurrentRegion.Delete
        .SpecialCells(12).Copy Hoja1.Range("A1")
        ListTabla.RowSource = Hoja1.Range("A1"). _
        CurrentRegion.Offset(1).Address(, , , 1)
        .AutoFilter
        .Columns("E:E").NumberFormat = "m/d/yyyy hh:mm"
    End With
    
End Sub

' Para bloquear la edicion del texbox

Private Sub UserForm_Initialize()


Me.txtFecha.ForeColor = RGB(0, 0, 0) ' Color negro

    Me.ListTabla.RowSource = "Primaria"
    Me.ListTabla.ColumnCount = 5
    Me.ListTabla.ColumnWidths = "100;190;200;90;150"
    Me.ListTabla.ColumnHeads = False

btnFecha.SetFocus

    Dim ws As Worksheet
    Dim cell As Range
    Dim rng As Range
    
    ' Definir la hoja de Excel de la que deseas leer los datos
    Set ws = ThisWorkbook.Sheets("Datos")
     
     
    ' Definir el rango específico que deseas mostrar en el ListBox
   Set rng = ws.Range("C39:C55")
    
    ' Limpiar el contenido existente del ListBox
    CbxDocentes.Clear
    
    ' Iterar sobre cada celda en el rango y agregar su valor al ListBox si no está vacía
    For Each cell In rng
       If Not IsEmpty(cell.Value) Then
           CbxDocentes.AddItem cell.Value
        End If
    Next cell
    
    Set rng = ws.Range("A60:A69")
    CbxMeses.Clear
    For Each cell In rng
       If Not IsEmpty(cell.Value) Then
           CbxMeses.AddItem cell.Value
        End If
    Next cell
End Sub

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.