98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA
VBA
Resolved · Low Priority · Version 2003
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?
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
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Change the Value of a ConstantWhen using a named constant in a worksheet, you may wish to change the value of that constant. |