Reputation: 1234
My problem is as follows:
I have two files opened - file1.xlsm
and file2.xlsm
. The first one is active. I want to switch back to the first workbook, every time I activate the second one. I put
Private Sub Workbook_Activate()
Windows("file1.xlsm").Activate
End Sub
in a macro module of the second workbook. It doesn't work. Is there a way to do it? Thanks for any help
Upvotes: 0
Views: 235
Reputation: 15561
You have to place
Private Sub Workbook_Activate()
Workbooks("file1.xlsm").Activate
End Sub
in the ThisWorkbook code window of file2.xlsm (not a macro module).
Upvotes: 1