The following code is debugging on me and I don't understand why. Can anyone see the error.
Code:
For Each myRange In Worksheets("clean").Range("A2:A" & Worksheets("clean").Range("A" & Rows.Count).End(xlUp).Row)
Selection.AutoFilter Field:=1, Criteria1:=myRange
a = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To a
If Rows(i).Hidden = False Then Exit For
Next i
If a <> i Then
colmax = Application.WorksheetFunction.Max(Range(Cells(i, 21), Cells(a, 21)))
maxadd = ActiveSheet.Range(ActiveSheet.Cells(i, 21), ActiveSheet.Cells(a, 21)).Find(colmax).Address
MsgBox maxadd
End If
Next myRange