Mostrar solo únicos al filtrar en textbox y sumar valores de otra columna
Para Dan
Disculpa Dan tantas preguntas!
Sabes que tengo un Textbox que filtro datos de cualquiera de tres columnas 1,2,10
Lo que deseo es que solo me muestre una vez el valor filtrado y que sume la columna 6 del listbox
Ejemplo
asi me aparece
Textbox = s09p
Listbox
Codigo columna6
s09p 5
s09p 1
Como deberia aparecer es
Textbox = s09p
Listbox
Codigo columna6
s09p 6
Se podrá hacer !!
Nose si me explico bien
Private Sub TextBox13_Change()
Application.ScreenUpdating = False
On Error Resume Next
lbltotal = ""
On Error Resume Next
Me.ListBox1.Clear
Hoja4.Select
ListBox1.ColumnCount = 8
ListBox1.ColumnWidths = "60;200;60;90;90;120;90;90"
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
cadena = UCase(Cells(i, 1).Value) & UCase(Cells(i, 2).Value) & UCase(Cells(i, 10).Value)
If cadena Like "*" & UCase(TextBox13.Value) & "*" Then
If Cells(i, "G") <> 0 Then
ListBox1.AddItem Cells(i, "A")
ListBox1. List(ListBox1.ListCount - 1, 0) = Cells(i, "A")
ListBox1. List(ListBox1.ListCount - 1, 1) = Cells(i, "H")
ListBox1. List(ListBox1.ListCount - 1, 2) = Cells(i, "I")
ListBox1. List(ListBox1.ListCount - 1, 3) = Cells(i, "B")
ListBox1. List(ListBox1. ListCount - 1, 4) = Format(Cells(i, "D"), "DD-MM-YYYY")
ListBox1. List(ListBox1. ListCount - 1, 5) = Format(Cells(i, "J"), "DD-MM-YY")
ListBox1.List(ListBox1.ListCount - 1, 6) = Format(Cells(i, "G"), "#0.00")
ListBox1.List(ListBox1.ListCount - 1, 7) = (Cells(i, "L"))
Else
End If
End If
Next i
Exit Sub
Errores:
MsgBox "No se encuentra.", vbExclamation, "EXCELeINFO"
End Sub
1 Respuesta
Respuesta de Dante Amor
3

