nniedzielski
Well-known Member
- Joined
- Jan 8, 2016
- Messages
- 598
- Office Version
- 2019
- Platform
- Windows
I am filtered a sheet down to look for invoices that are over 30 days old, and then want to loop through, check the cell contents and keep a count if it matches up or not, but this is looping visible and non visible cells both, how can i filter only visible cells?
thank you,
VBA Code:
data.Range("A:AT").AutoFilter Field:=10, Criteria1:= _
"Greater than 30"
lastRow = Range("A" & Rows.Count).End(xlUp).Row
For x = 1 To lastRow
returnNum = 0
If Cells(x, 6) = "Paid" Then
'do nothing
Else
returnNum = returnNum + 1
End If
Next x
thank you,