Linda has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Macros
How would I go about recording a macro involving multiple workbooks, can I use recorder?
Recording the opening of a workbook
Hi Linda
The simple answer is YES, you can use the macro recorder to record the code involving multiple workbooks. The example I give below was recorded by me and from an open workbook it opens another workbook, brings some data across and then closes the workbook.
Sub Test
Workbooks.Open Filename:="C:My Documents\Accounts 2007.xls"
Windows("Accounts 2008.xls").Activate
Range("J7").Select
ActiveCell.FormulaR1C1 = "='[Accounts 2007.xls]Sheet1'!R9C4"
Windows("Accounts 2007.xls").Close
End Sub
You can then edit the code for better use; like stopping the screen updating so the user doesn't see the other workbook being accessed.
Hope this helped
Carlos