✔ 最佳答案
Sub 巨集1()
Dim y As Long
Sheets("資料來源").Select
y = Sheets("資料來源").[U65536].End(xlUp).Row
Range(Cells(2, 22), Cells(2, 30)).AutoFill Destination:=Range(Cells(2, 22), Cells(y, 30))
For i = 1 To 3
Sheets("測試" & i).Select
Range(Cells(2, 1), Cells(2, 13)).AutoFill Destination:=Range(Cells(2, 1), Cells(y, 13))
Next
End Sub
Sub 巨集1()
Dim y As Long
Sheets("資料來源").Select
y = Sheets("資料來源").[U65536].End(xlUp).Row
Sheets("有留言24").Select
Range(Cells(2, 1), Cells(2, 13)).AutoFill Destination:=Range(Cells(2, 1), Cells(y, 13))
Sheets("有留言40").Select
Range(Cells(2, 1), Cells(2, 13)).AutoFill Destination:=Range(Cells(2, 1), Cells(y, 13))
Sheets("3C&配件").Select
Range(Cells(2, 1), Cells(2, 13)).AutoFill Destination:=Range(Cells(2, 1), Cells(y, 13))
End Sub
arr = Array("有留言24", "有留言40", "3C&配件")
For i = 0 To 2
Sheets(arr(i)).Select
Range(Cells(2, 1), Cells(2, 13)).AutoFill Destination:=Range(Cells(2, 1), Cells(y, 13))
Next