2
我有一系列的數據是在一本書的每個工作表的同一位置,並始終處於那個位置。當宏運行時,數據應該被複制並添加到報表中。我有這部分工作,但我需要使用特殊的粘貼:需要添加特殊粘貼條件的copy.destination for循環
.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
太棒了!我可以在7分鐘內接受這個.. :) :) –