marreco
Well-known Member
- Joined
- Jan 1, 2011
- Messages
- 609
- Office Version
- 2010
- Platform
- Windows
Hi.
Code:
Sub myFilter2()'Coded by RickXL
'https://www.mrexcel.com/forum/excel-questions/917998-wild-card-unable-use-autofilter-array.html
Dim dic As Object
Dim eleData As Variant
Dim eleCrit As Variant
Dim arrData As Variant
Dim vTst As Variant
Set dic = CreateObject("Scripting.Dictionary")
vTst = Array("*Cancel*", "*cancel*")
With ActiveSheet
.AutoFilterMode = False
arrData = .Range("E2:E" & .Cells(.Rows.Count, "E").End(xlUp).Row)
For Each eleCrit In vTst
For Each eleData In arrData
If eleData Like eleCrit Then dic(eleData) = vbNullString
Next
Next
'If value each cell in coluna E has a text like this("*Cancel*", "*cancel*") then
'Insert letter w into each cell in column AT
'I try this
.Offset(, 41).Value = dic(eleData.Value)
End With
End Sub