ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to switch between different workbooks? (https://www.excelbanter.com/excel-programming/348818-how-switch-between-different-workbooks.html)

ivan

How to switch between different workbooks?
 
Hi,

If I want to switch between (activate) different opened excel workbooks,
what code should I use in VBA?
Thanks.

Ivan

Norman Jones

How to switch between different workbooks?
 
Hi Ivan,

If I want to switch between (activate) different opened excel workbooks,
what code should I use in VBA?


Perhaps I misunderstand but:

'=============
Sub Tester03()
Dim WB1 As Workbook, WB2 As Workbook, WB3 As Workbook

Set WB1 = Workbooks("Book1.xls")
Set WB2 = Workbooks("Book2.xls")
Set WB3 = Workbooks("Book3.xls")

WB2.Activate

End Sub
'<<=============

---
Regards,
Norman


"Ivan" wrote in message
...
Hi,

If I want to switch between (activate) different opened excel workbooks,
what code should I use in VBA?
Thanks.

Ivan




ivan

How to switch between different workbooks?
 
Hi Norman,

Thanks a lot! It helps.

Ivan

"Norman Jones" wrote:

Hi Ivan,

If I want to switch between (activate) different opened excel workbooks,
what code should I use in VBA?


Perhaps I misunderstand but:

'=============
Sub Tester03()
Dim WB1 As Workbook, WB2 As Workbook, WB3 As Workbook

Set WB1 = Workbooks("Book1.xls")
Set WB2 = Workbooks("Book2.xls")
Set WB3 = Workbooks("Book3.xls")

WB2.Activate

End Sub
'<<=============

---
Regards,
Norman


"Ivan" wrote in message
...
Hi,

If I want to switch between (activate) different opened excel workbooks,
what code should I use in VBA?
Thanks.

Ivan






All times are GMT +1. The time now is 04:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com