Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50199

copy data from one tab to another tab from another worbook

$
0
0
Hi.
how to copy the book "Origin.xlsx" and tab "Base" for the book "Destination.xlsx" tab within the "Result"?

i'm try this
Code:

Sub CopySheetBase()
Dim wkbSource As Workbook
Dim wkbDest As Workbook
Dim shtToCopy As Worksheet

Set wkbSource = Workbooks.Open("C:\Origin.xlsx")
Set wkbDest = Workbooks.Open("C:\Origin.xlsx")
Set shtToCopy = wkbSource.Sheets("Destination.xlsx")
shtToCopy.copy wkbDest.Sheets("Result")
End Sub


Viewing all articles
Browse latest Browse all 50199

Trending Articles