Dear,
Please i need support in retrieving the autofilter data to listbox, as when running the code the autofilter is reflecting the the source sheet only but the listbox have the entire range
Gratefully,
Please i need support in retrieving the autofilter data to listbox, as when running the code the autofilter is reflecting the the source sheet only but the listbox have the entire range
Code:
Private Sub btn_Redeem_Click()
Application.ScreenUpdating = False
Dim crng As Range
With Sheet2.ListObjects("Table_Source")
Dim LastRow As Long
Dim index As Integer
Dim a As Worksheet
Dim number_of_rows As Long
Set a = ThisWorkbook.Sheets("Deduction")
With a
.Range("B2").AutoFilter Field:=2, Criteria1:="Dec"
.Range("X2").AutoFilter Field:=33, Criteria1:="Marina.Gobran"
number_of_rows = .Range("Y" & .Rows.Count).End(xlUp).Row
ListBox1.AddItem ("Date" & " Total Deduction " & " Name ")
For index = 2 To (32500 - 1)
ListBox1.AddItem (a.Cells(index, 1) & " " & a.Cells(index, 24) & " " & a.Cells(index, 25))
Next
End With
End With
End Sub
Gratefully,