Private Sub CommandButton2_Click() For Z = 2 To Sheet2.[b65536].End(3).Row Next Application.ScreenUpdating = False Dim j As Integer Dim souce As Worksheet Dim target As Workbook Set souce = ThisWorkbook.Worksheets("正式表") Set target = Workbooks.Open(ThisWorkbook.Path & "\凭证.xls") target.Sheets(1).Rows.Delete souce.Range(souce.Cells(1, 1), souce.Cells(Z - 1, 38)).Copy target.Sheets(1).Range(target.Sheets(1).Cells(1, 1), target.Sheets(1).Cells(Z - 1, 38)) Application.ScreenUpdating = True ActiveWorkbook.Save ActiveWorkbook.Close End Sub
把一个工作簿中的表的数据传递到另一个工作簿中。
原文地址:https://www.cnblogs.com/flyer2018/p/10130423.html
时间: 2024-10-09 13:18:57