note, asked a variant of this question on mrexcel as well, i'll update if a solution in the other ay becomesavailable.
So, I have a table called "Talent".
I wish to autofilter the table based on 8 columns. The value in "$C$4" will appear in only one of the columns, although it may be a different one every time. So i need it to try each column until it finds results and then exit the loop leaving just those results on screen. I got as far as this, with my limited VBA knowledge, but keep getting an error. (Runtime 91)
I may be barking up the wrong tree, but hopefully im on the right tracks. Any suggestions for correcting would be appreciated.
Sub Autofilterallcolumns2()
Application.ScreenUpdating = False
With Sheets("Talent")
Rows("13:1250").Hidden = False
End With
Application.ScreenUpdating = True
Dim RTF As Range, i As Long
Set RTF = Range("Talent")
With Sheets("Talent")
For i = 11 To 18
.Activate
.AutoFilterMode = False
RTF.AutoFilter
RTF.AutoFilter field:=10, Criteria1:=Cells(4, 3).Value
If .AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible).Count >= 2 Then
Exit For
ElseIf .AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible).Count < 2 Then
Call Clear_All2
End If
Next
End With
End Sub