Hi Team,
Need your help in filtering Below data, Filter out xxxx and yyyy.
It is hardcoded, how to pass Criteria from Range. Thanks.
Regards,
mg
Need your help in filtering Below data, Filter out xxxx and yyyy.
It is hardcoded, how to pass Criteria from Range. Thanks.
VBA Code:
sub autofilterDynamically
Dim arg1 as variant
arg1 = application.worksheetfunction.Transpose(Mapping.Range("A2:A3"))
'below line worked how to make it dynamic
Range("A1").currentregion.AutoFilter field:=2, Criteria1:= _
"<>xxxx*", Operator:=xlAnd, Criteria2:="<>yyyy*"
'Something like this. ' it is not working
Range("A1").currentregion.AutoFilter field:=2, Criteria1:= array("<>"& arg1),operator:= xlfiltervalues
end sub
Regards,
mg