Hi all,
I wrote a macro coding to filter data from active sheet from specific companies by company ID that I inputted in the other sheet named "ID". The company ID only contains list of numbers. When I run the macros, it filtered out all the values even though some of the ID that I inputted in the sheet named "ID" present in the data. Below is my coding;
Sub FilterID()
Dim vCrit As Variant
Dim wsD As Worksheet
Dim wsC As Worksheet
Dim rngCrit As Range
Dim rngData As Range
Set wsD = ActiveSheet
Set wsC = Worksheets("ID")
Set rngData = wsD.Range("$A$1:$XFD$1048576")
Set rngCrit = wsC.Range("$A$1:$A$283")
vCrit = rngCrit.Value
rngData.AutoFilter _
Field:=3, _
Criteria1:=Application.Transpose(vCrit), _
Operator:=xlFilterValues
End Sub
Bookmarks