现在有三个excel(A,B和C)
所有操作在A中进行,在A中点一个按钮,自动把excel(B)的sheet1中【B2:E2,B3:E3】范围的值,拷贝到excel(C)中,操作过程中,excel(A和B)不打开,怎么写这个VBA?
Dim app As New Application
Dim fromsheet, tosheet As Worksheet
Set fromsheet = app.Workbooks.Open("B.xls").Sheets("sheet1")
Set tosheet = app.Workbooks.Open("C.xls").Sheets("Sheet1")
Dim selectpart As String
selectpart = "B2:E2,B3:E3"
fromsheet.Range(selectpart).Select
Selection.Copy
tosheet.Activate
Range("A1").Select
ActiveSheet.Paste
app.Workbooks("B.xls").Close
app.Workbooks("C.xls").Save
app.Workbooks("C.xls").Close
这么写怎么不行呢?
Wang the suspect's girlfriend fell in love four years to break, Wang angry Nanchang County man will kill his girlfriend at home. To avoid legal sanctions, he made both he and his girlfriend false sentimentalism, trying to disrupt the police investigation. However, the cunning of the fox eventually exposed the tail. gir...