Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

go back to new workbook

Posted on 2013-06-14
1
Medium Priority
?
293 Views
Last Modified: 2013-06-19
I run a macro that open a new workbook. The workbook could open as Book1 or Book2 or Book 3 etc.......

I need [using VBA] to copy from sheet1 of my original file onto Sheet1 of the new workbook, go back to my original workbook Sheet2 the copy the data from that sheet onto Sheet2 on the new workbook.

As the new workbook is not always Book1 etc is this not possible?
0
Comment
Question by:Jagwarman
1 Comment
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 39247465
Hi,

YOu can use set to refer to the right work book

Set wbkSource = ActiveWorkbook
Set wbkDest = Workbooks.Add(Template:="Workbook")
wbkDest.Activate

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question