Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA
VBA
Resolved · Medium Priority · Version 2003
VBA
Can a macro be written which incorporates data from a second workbook?For upcoming training course dates see: Pricing & availability
RE: VBA
Hi IvanThank 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
|
|
» Forum post: View |



Course updates

