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 · Medium Priority · Version 2003
Ivan has attended:
Excel VBA Intro Intermediate course
VBA
Can a macro be written which incorporates data from a second workbook?
RE: VBA
Hi Ivan
Thank you for your question regarding Workbooks in VBA.
Yes you can access data in other workbooks in VBA, you will need to open the workbooks.
Dim mybook as Workbook
Dim myotherbook as Workbook
'
Set mybook = ActiveWorkbook
' Open other workbook
Workbooks.Open "Book2.xls"
set myotherbook = ActiveWorkbook
You can then use mybook.Activate and myotherbook.Activate to switch between the two books.
Please let me know how you get on.
Laura GB
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:Transpose textYou can transpose any range of cells, turning the columns into rows and the rows into columns. Just follow these steps: |