あなたはこの
Sub main()
Dim ws As Worksheet, openWs As Worksheet
Set openWs = Worksheets("Open Items") '<--| be sure you already have a sheet named after "Open Items"
For Each ws In Worksheets '<--| loop through worksheets
If ws.Name <> "Open Items" Then '<--| if current sheet isn't named after "Open Items"
With ws
With .Range("C3", .Cells(Rows.Count, "C").End(xlUp)) '<--| reference its column AE range from row 1 (header) down to the one corresponding to last column A not empty row
.AutoFilter Field:=1, Criteria1:="Open" '<--| filter column C cells with "Open" content
If Application.WorksheetFunction.Subtotal(103, .Cells) > 1 Then '<-_| if any filtered cell found other than headers
.Offset(1).Resize(.Rows.Count - 1, 7).SpecialCells(xlCellTypeVisible).Copy openWs.Cells(Rows.Count, 1).End(xlUp).Offset(1) '<--| '<--| copy filtered cell (skipping headers) and paste then from "Open Items" sheet column A first empty cell after last not empty one
End If
End With
.AutoFilterMode = False
End With
End If
Next
End Sub
質問が広すぎる試みることができるありがとうございます。この時点で試行されたコードと、それが失敗する特定の問題を提供します。 – Zerk
私はif文を使用しようとしましたが、 "Open Items"タブに行全体を移動する方法がわかりません – TacosaurusRex