View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default 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