+ Reply to Thread
Results 1 to 3 of 3

How to switch between different workbooks?

  1. #1
    Ivan
    Guest

    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

  2. #2
    Norman Jones
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > If I want to switch between (activate) different opened excel workbooks,
    > what code should I use in VBA?
    > Thanks.
    >
    > Ivan




  3. #3
    Ivan
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > >
    > > If I want to switch between (activate) different opened excel workbooks,
    > > what code should I use in VBA?
    > > Thanks.
    > >
    > > Ivan

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1