書籍のすべてのワークシートで同じ位置にあり、常にその位置にある一連のデータがあります。マクロを実行するときは、データをコピーしてレポートシートに追加する必要があります。私はその部分を機能させていますが、特別なペーストを使用する必要があります:
.PasteSpecial xlPasteValues
範囲内に数式があるため。を使用しているため、このコードのどこに貼り付け特殊条件を追加するかわかりません.Copy, Destination
。
Option Explicit
Sub CreateTempPSDReport()
Dim WS As Worksheet, Rept As Worksheet
Set Rept = Sheets("Temporary PSD Report")
Application.ScreenUpdating = False
'--> Loop through each worksheet except the report and
'--> Copy the set range to the report
For Each WS In ThisWorkbook.Worksheets
If Not WS.Name = "Temporary PSD Report" Then
WS.Range("A42", "I42").Rows.Copy _
Destination:=Rept.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
Next
Application.ScreenUpdating = True
End Sub