Como cargar nombres y hojas en la tabla

Como puedo hacer para cargar los nombres y las hojas en la tabla en el formulario

1 Respuesta

Respuesta
1

Para agregar los datos a los combos

Private Sub UserForm_Activate()
'Por.Dante Amor
    'Cargar
    Set h2 = Sheets("NOMBRES")
    h2.Range("A2:B" & h2.Range("A" & Rows.Count).End(xlUp).Row + 2).Clear
    j = 2
    For Each h In Sheets
        una = True
        Select Case UCase(h.Name)
            Case Is = "PLANTILLA", "BUSCAR", "NOMBRES"
            Case Else
                'carga hojas
                ComboBox1.AddItem h.Name
                'carga nombres
                For i = 4 To h.Range("A" & Rows.Count).End(xlUp).Row
                    If una Then
                        pri = h.Cells(i, "A")
                        una = False
                    Else
                        If h.Cells(i, "A") = pri Then Exit For
                    End If
                    If h.Cells(i, "A") <> "" Then
                        h2.Cells(j, "A") = h.Cells(i, "A")
                        h2.Cells(j, "B") = h.Name
                        j = j + 1
                    End If
                Next
        End Select
    Next
    u = h2.Range("A" & Rows.Count).End(xlUp).Row
    ListBox1.RowSource = h2.Name & "!A2:B" & u
    '
    'Carga tipos
    '"vacaciones, permiso o pex"
    ComboBox2. AddItem "Vacaciones"
    ComboBox2. AddItem "Permiso"
    ComboBox2. AddItem "Pex"
End Sub

'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas