Hello, I wish you a good day, the thing is this ...
I currently have this code for a button
Private Sub btnfiltrar_Click()
On Error GoTo ErroresIf
Me.txtfiltro.Value = "" Or Me.txtfiltro.Value = " " Then
Me.ltbdatos.Clear
Else
Me.ltbdatos.Clear
j = 1
Set BD = ThisWorkbook.Sheets("APU")
Filas = BD.Range("C2").CurrentRegion.Rows.Count
For i = 2 To Filas
If LCase(BD.Cells(i, j).Offset(0, 2).Value) Like "*" & LCase(Me.txtfiltro.Value) & "*" Then
Me.ltbdatos.AddItem BD.Cells(i, j)
Me.ltbdatos.List(Me.ltbdatos.ListCount - 1, 1) = BD.Cells(i, j).Offset(0, 2)
Me.ltbdatos.List(Me.ltbdatos.ListCount - 1, 2) = BD.Cells(i, j).Offset(0, 15)
Else
End If
Next i
End If
Exit Sub
Errores:
MsgBox "No existe.", vbExclamation
End Sub
With this code I bring the data from column A, C and P to a ListBox; But I just need you to bring me the data from columns C and P, how should I modify that code to achieve what I want?