Forum Discussion
Kalogeros
Aug 18, 2022Copper Contributor
Ecxel VBA
Hi, i would like to filter a table (5000+ rows, 20+ columns) with multiple criteria. More specifically, i would like to give a unique id ( 6digit NUMBER from the first column) and return ALL the oth...
NikolinoDE
Aug 18, 2022Platinum Contributor
VBA Code...
Sub AutofilterInput()
Dim Criterion1 As String, Range As Range
Set Range = ActiveSheet.UsedRange ' Adjust range accordingly
'Filter searches for "contains search text"
Criterion1 = "=*" & InputBox("Text you're looking for?", "Autofilter search term", "Search text") & "*"
If Criterion1 = "=**" Then Exit Sub
Range.AutoFilter Field:=1, Criteria1:=Kriterium1 'If several columns have an auto filter, adjust the field number if necessary
end sub
...or
Filter by using advanced criteria
Hope I could help you with these information / links.
I know I don't know anything (Socrates)
Kalogeros
Aug 30, 2022Copper Contributor
NikolinoDE Thanks for the reply, but i'm trying to do something like the example below.
I'm trying to replicate FILTER function with VBA in Excel 2016-2019.
Ask me if there is anything you can't understand.