G
Guest
I would like to copy a worksheet from FileA to FileB by using the listed
code, but it is strange that the result is just the opposite; it copies FileB
to FileA. Could someone please help.
The codes are as follows:-
Sub test()
Dim wb As Workbook, ws As Worksheet
Set ws = ThisWorkbook.ActiveSheet
Set wb = Workbooks.Open("C\FileB.xls")
wb.Sheets(1).Range("A1").Copy
ws.Range("A!").PasteSpecial xlPasteValues
wb.Close Savechanges:=False
End Sub
Thanks
code, but it is strange that the result is just the opposite; it copies FileB
to FileA. Could someone please help.
The codes are as follows:-
Sub test()
Dim wb As Workbook, ws As Worksheet
Set ws = ThisWorkbook.ActiveSheet
Set wb = Workbooks.Open("C\FileB.xls")
wb.Sheets(1).Range("A1").Copy
ws.Range("A!").PasteSpecial xlPasteValues
wb.Close Savechanges:=False
End Sub
Thanks