my code is not refreshing the autofilter. For i = 8
the code works, but on next i
it doesn't update the autofilter field. The "no_filtered_rows" shows 0 rows (while there should be).
For i = 8 To ostD
accounts() = Split(Worksheets("k").Range("B" & i).Value, ",")
For j = 0 To UBound(accounts)
sAccNo = Trim(accounts(j))
Set rFind = .Cells.Find(sAccNo)
If Not rFind Is Nothing Then
.ShowAllData
.Range("A1:G" & ostD).AutoFilter Field:=3, Criteria1:=rFind
no_filtered_rows = .Range("A1:G" & ostD).SpecialCells(xlCellTypeVisible).Rows.Count - 1
End Sub