Avatar of mldaigle1
mldaigle1
Flag for Canada asked on

Excel Macro - Copy / Paste Sheets from one workbook to another

Hello Experts,

I'm sure this is very simple, but need your expertise to do that macro.   I need to copy data from workbookA.SheetIN_Data and paste it into workbookB.SheetIN_Data, starting at cell A2 (Row 1 are my headers in workbookB).

I have a total of 6 sheets that need the data to be transfert from one book to the other (SheetIN_Data,SheetCH_Data, SheetWO_O, SheetWO_B, SheetWO_H, Sheet_PR).

Can you help?
Microsoft Excel

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
gowflow

Best and most efficient is you to post both workbooks and will take it from there.
gowflow
Martin Liss

Sub CopySheetData()

Dim wbDest As Workbook
Dim wbSource As Workbook

Set wbSource = ActiveWorkbook
Set wbDest = Workbooks("workbookB")

wbSource.Sheets("SheetIN_Data").UsedRange.Cells.Offset(1, 0).Copy Destination:=wbDest.Sheets("SheetIN_Data").Range("A2")


End Sub

Open in new window

Roy Cox

Is the data from all sheets being consloidated into one sheet in the other workbook?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
Martin Liss

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mldaigle1

ASKER
Hi Martin,

This work just fine!!

thanks,

xxx

/mld
Martin Liss

You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015, Experts-Exchange Top Expert Visual Basic Classic 2012 to 2014