==[[Excel VBA オートフィルタをシート間で同期]]==
[[Excel]] | [[Excel VBA]] |
====オートフィルタの状態をシート間で同期させる====
Sub SyncAutoFilter()
Dim srcSht As [[Excel]].Worksheet '同期元のシート Dim dstSht As [[Excel]].Worksheet '同期元のセル Dim srcCell As [[Excel]].Range '同期元のシート Dim dstCell As [[Excel]].Range '同期先のセル
'対象セルの位置
Case xlAnd, xlOr
'条件指定 AND、ORAND、O[[R]]
dstCell.AutoFilter Field:=fld, _
Criteria1:=srcSht.AutoFilter.Filters(idx).Criteria1, _