軟體:EXCEL
版本:2010
如下VBA碼 能否將 "工1" 透過迴圈進行複製
Sub n()
'......(以上省略)
Set 工1 = Range(Cells(12, "B"), Cells(最末列, "B"))
Set 工2 = Range(Cells(12, "C"), Cells(最末列, "C"))
Set 工3 = Range(Cells(12, "D"), Cells(最末列, "D"))
Sheets(某工作表).Select
For i = 1 To 3
XXX = "工" & i '第一次指定為工1 ...以此類推
XXX.Copy: Cells(2, i).Select: ActiveSheet.Paste
'↑XXX.Copy將出現錯誤
Next
End Sub
謝謝