|
AA列に抽出条件を書き込むとすると、こんな感じで。
Sub Try1()
Dim v
Dim cR As Range
v = Array("ER431", "NC431", "NC442", "NC531")
With [AA2].Resize(UBound(v) + 1)
.Value = Application.Transpose(v)
.Value = Application.Replace(.Cells, 1, 0, "'=")
End With
[AA1].Formula = "=I1"
Set cR = [AA1].CurrentRegion
With Range("A1").CurrentRegion
.AdvancedFilter xlFilterInPlace, cR '抽出
If .Columns(1).SpecialCells(xlVisible).Count > 1 Then
MsgBox "抽出されたデータです"
Else
MsgBox "抽出なし"
End If
.Worksheet.ShowAllData 'すべて表示
End With
Columns("AA").Clear
End Sub
|
|