|
こんな感じで、どうでしょーか ?
Sub 抽出2()
Dim FName As String
Dim Cnt As Long
With Application
FName = .GetOpenFilename("CSVファイル (*.csv), *.csv")
If FName = "False" Then Exit Sub
.ScreenUpdating = False
End With
Workbooks.Open FName
With Range("A1")
.AutoFilter 1, "10日"
.AutoFilter 3, "10000"
End With
Cnt = ActiveSheet.AutoFilter.Range.Columns(1) _
.SpecialCells(12).Count
If Cnt > 1 Then
Cnt = Cnt - 1
MsgBox "日付10日でID1000は " & Cnt & " 個あります"
Else
MsgBox "抽出件数なし"
End If
ActiveSheet.AutoFilterMode = False
ActiveWorkbook.Close False
Application.ScreenUpdating = True
End Sub
|
|