I want to do a self-filtering through VBA of a table with multiple columns.
My intention is that it does not filter to infinity, if I do not always have control knowing which is the last record of my table.
My code is the following:
last = Range(sh.Cells(2, 1), sh.Cells(2, 1)).End(xlDown).Row
With sh ' Viene de un set. Se viene a referir a la hoja actual
.AutoFilterMode = False
.Range(.Cells(2, 20), .Cells(last, 20)).AutoFilter 20, "No" 'EL ERROR ME LO DA CON RANGE
End With
The error shown by the excel is the following: "Error in the AutoFilter method of the Range class."
Any ideas?
Thank you very much.