ListBox1 no muestra todos los datos

Tengo un formulario con un textbox de filtro y debe de mostrarme todos los datos al filtrar el numero de cedula pero solo me muestra el numero de planilla.

Alguna ayuda por favor.

'Cerrar formulario
Private Sub CommandButton2_Click()
Unload Me
End Sub
'
'Abrir el formulario para modificar
Private Sub CommandButton3_Click()
If Me.ListBox1.ListIndex < 0 Then
MsgBox "No se ha elegido ningún registro", vbExclamation, "EXCELeINFO"
Else
MODIFICAR.Show
End If
End Sub
'
'Eliminar el registro
Private Sub CommandButton4_Click()

If Me.ListBox1.ListIndex < 0 Then
MsgBox "No se ha elegido ningún registro", vbExclamation, "EXCELeINFO"
Else
Pregunta = MsgBox("Está seguro de eliminar el registro?", vbYesNo + vbQuestion, "EXCELeINFO")
If Pregunta = vbYes Then
ActiveCell.EntireRow.Delete
End If
End If
'Mandamos llamar el botón filtrar
Call CommandButton1_Click
End Sub
'
'Mostrar resultado en ListBox
Private Sub CommandButton1_Click()
On Error GoTo Errores
If Me.TextBox2.Value = "" Then Exit Sub
Me.ListBox1.Clear
j = 1
Filas = Range("a1").CurrentRegion.Rows.Count
For i = 2 To Filas
If LCase(Cells(i, j).Offset(0, 1).Value) Like "*" & LCase(Me.TextBox2.Value) & "*" Then
Me.ListBox1.AddItem Cells(i, j)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = Cells(i, j).Offset(0, 1)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = Cells(i, j).Offset(0, 2)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 3) = Cells(i, j).Offset(0, 3)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 4) = Cells(i, j).Offset(0, 4)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 5) = Cells(i, j).Offset(0, 5)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 6) = Cells(i, j).Offset(0, 6)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 7) = Cells(i, j).Offset(0, 7)
Else
End If
Next i
Exit Sub
Errores:
MsgBox "No se encuentra.", vbExclamation, "EXCELeINFO"
End Sub
'
'Activar la celda del registro elegido
Private Sub ListBox1_Click()
Range("a2").Activate
Cuenta = Me.ListBox1.ListCount
Set Rango = Range("A1").CurrentRegion
For i = 0 To Cuenta - 1
If Me.ListBox1.Selected(i) Then
Valor = Me.ListBox1.List(i)
Rango.Find(What:=Valor, LookAt:=xlWhole, After:=ActiveCell).Activate
End If
Next i
End Sub

1 Respuesta

Respuesta
1

No muestra todos los datos, pero si te muestra todos los registros.

¿Cambiaste la propiedad de ColumCount del Listbox a 8?

Si no es lo de la propiedad, podrías enviarme tu archivo para revisarlo.

Mi correo [email protected]

En el asunto del correo escribe tu nombre de usuario “Eduar Esparragoza

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas