我对此有点难过,想知道是否有人可以帮忙?我在 excel 中创建了一个宏来将一些数据从一个工作表复制到另一个工作表。它工作正常,但显然每次我运行宏时,它都会完成第一行(正如我在录制时粘贴的那样)。我实际上希望它能够工作,以便每次运行宏时,它都会将数据复制到新行。
如果有帮助,我可以粘贴指向该文档的链接。我确定这只是将一些 VBA 代码粘贴到宏中的情况。目前,代码如下所示:
Sub Macro1()
'
' Macro1 Macro
'
'
Sheets("Quotation System").Select
Range("K9").Select
Selection.Copy
Sheets("Confirmed Bookings").Select
Range("A2").Select
ActiveSheet.Paste
Range("B2").Select
Sheets("Quotation System").Select
Range("K11").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
ActiveSheet.Paste
Sheets("Quotation System").Select
Range("K13").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
Range("C2").Select
ActiveSheet.Paste
Sheets("Quotation System").Select
Range("K15").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
Range("D2").Select
ActiveSheet.Paste
Columns("D:D").EntireColumn.AutoFit
Columns("D:D").EntireColumn.AutoFit
Columns("D:D").ColumnWidth = 10.86
Sheets("Quotation System").Select
Range("K17").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
Range("E2").Select
ActiveSheet.Paste
Range("F2").Select
Sheets("Quotation System").Select
Range("K19").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
ActiveSheet.Paste
Columns("F:F").ColumnWidth = 8.57
Sheets("Quotation System").Select
Range("K21").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
Range("G2").Select
ActiveSheet.Paste
Range("H2").Select
Sheets("Quotation System").Select
Range("K23").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
ActiveSheet.Paste
Range("I2").Select
Sheets("Quotation System").Select
Range("K25").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
ActiveSheet.Paste
Sheets("Quotation System").Select
Range("K7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
Range("J2").Select
ActiveSheet.Paste
Range("K2").Select
Sheets("Quotation System").Select
Range("G29").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Confirmed Bookings").Select
ActiveSheet.Paste
Columns("K:K").EntireColumn.AutoFit
Columns("K:K").ColumnWidth = 6
Columns("K:K").ColumnWidth = 7
Range("K2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "='Quotation System'!R[27]C[-4]"
Range("K3").Select
Columns("J:J").EntireColumn.AutoFit
Range("I19").Select
Columns("A:A").ColumnWidth = 8.43
End Sub
Sub Booking_confimred()
End Sub
非常感谢!