| 
    
     |  | ▼sa さん: こんばんは。
 
 >オートフィルターの抽出条件をグラフの題にしたいので
 >   抽出条件を文字列として得たいのですが宜しくお願いします
 > (例えば)
 >   抽出条件が(すべて)なら すべて
 >         12月 なら 12月
 Filterオブジェクトなるものがありますので、Helpで調べてみて下さい。
 以下は、一例です。抽出後に実行してみて下さい。
 '===============================================================
 Sub test()
 Dim ope
 Dim ope_str
 ope = Array(xlAnd, xlOr, xlBottom10Items, xlBottom10Percent, xlTop10Items, xlTop10Percent, 0)
 ope_str = Array("AND", "Or", "Bottom10Items", "Bottom10Percent", "Top10Items", "Top10Percent", "")
 With ActiveSheet
 If .AutoFilterMode Then
 With .AutoFilter.Filters(1)
 If .On Then
 idx = Application.Match(.Operator, ope, 0) - 1
 If idx > 1 Then
 MsgBox .Criteria1
 Else
 MsgBox .Criteria1 & " " & ope_str(idx) & " " & .Criteria2
 End If
 Else
 MsgBox "すべて"
 End If
 End With
 End If
 End With
 End Sub
 
 |  |