vba
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA

VBA

resolvedResolved · Low Priority · Version 2003

replyReply Tue 4 Nov 2008, 16:11Delegate Ivan said...

Ivan has attended:
Excel VBA Intro Intermediate course

VBA

How do you copy data from one workbook and paste into a different workbook using macro?

For upcoming training course dates see: Pricing & availability

replyReply Mon 10 Nov 2008, 16:31Trainer Carlos said...

RE: VBA

Hi Ivan

The way to copy data between 2 workbooks is to have both workbooks open at the time.

So from Workbook1 you need to open Workbook2. To do this:

ChDir "C:\"
Workbooks.Open Filename:="C:\My Doduments\Workbook2.xls

You then indicate which data is to be copied and where it is to be pasted.

When the copy and paste has been done you close Workbook 2 as follows:
.
Windows("Workbook2.xls").Activate
ActiveWorkbook.Save
ActiveWorkbook.Close

Hope this helps

Carlos

 

Please browse our web site to find out more about
microsoft excel training day courses near kent and other Microsoft training courses.

Excel tip:

Moving or Copying Sheets Between Workbooks in Excel 2010

Here's how to move or copy sheets between workbooks in Excel 2010:

Open the sheet you want to move or copy then on the Ribbon click the Home tab. Click Format. Under Organize Sheets, select the option Move or Copy Sheet and then choose where you want the sheet to be moved/copied to.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard