数据不多,用复制黏贴就可以啦。
Private Sub CommandButton2_Click()
Set WK = Workbooks.Open(ThisWorkbook.Path & "\Out.Xlsm")
With WK.Sheets("BB")
W = .[A65536].End(3).Row
If W < 6 Then W = 6
.Cells(W, 1) = Split([G1], "-")(0)
.Cells(W, 2) = Year([C1])
.Cells(W, 3) = [C1]
.Cells(W, 4) = [E1]
For i = 3 To 17
Set C = .Cells.Find(Cells(i, "A").Value, lookat:=xlWhole)
CL = C.Column
Range(Cells(i, "F"), Cells(i, "J")).Copy .Cells(W, CL)
Next
End With
WK.Close True
End Sub