フィルタリング後に結果がある場合は自動フィルタリングされた範囲をコピーして新しいワークシートに貼り付け、結果がない場合はメッセージボックスを表示します。私は結果を返しませんでしたフィルタ基準を使用してテストするときVBA:オートフィルタがデータを返さないときにメッセージボックスを出力する
ただし、メッセージボックスが表示されませんが、ときにアクティブなシートではなく、仕事をしたい
Dim WSNew As Worksheet
Set WSNew = Worksheets.Add
Dim rngVisible As Range
Set rngVisible = ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible)
If rngVisible.Rows.Count > 1 Or rngVisible.Areas.Count > 1 Then
rngVisible.Copy
With WSNew.Range("A1")
.PasteSpecial Paste:=8
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
.Select
End With
Else
MsgBox ("No such filtered criteria")
End If
可能な重複[オートフィルタの変更を検出](https://stackoverflow.com/questions/33081249/detect-autofilter-changes) – Ralph