表1 名称金额 abc 25.00 bba 45.00
Sub sbCopyRangeToAnotherSheet()
Sheets("sheet1").Range("A:B").Copy Destination:=Sheets("Sheet4").Range("a1")
End Sub
如果我有多张表,我应该如何写而不是(sheet1)到目标文件到表4?
答案 0 :(得分:0)
Sub sbCopyRangeToAnotherSheet()
dim col as integer
col = 1
For Each wks In Worksheets
if (wks.Name <> "Sheet4") then
wks.Range("A:B").Copy Destination:=Sheets("Sheet4").Cells(1, col)
col = col + 2
end if
next wks
End Sub