+ Reply to Thread
Results 1 to 5 of 5

Activate workbook syntax?

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    61

    Activate workbook syntax?

    Sorry, I have almost no knowledge of VBA!

    I'm trying to switch between workbooks whose names are variable. I can get the syntax for activating a workbook with a specific name correct, but I can't get it to work by referring to the workbook variable...

    My code:

    Set InputWbk = ActiveWorkbook

    Workbooks("Output.xlsx").Worksheets("Sheet1").Activate ' Works fine because the full file name is there

    Workbooks(InputWbk).Worksheets("Sheet1").Activate ' Not working...


    This should be very simple but my hunt for the correct syntax on Google is not turning up anything - everything I can find works exclusively with specific file names.

    Thanks in advance for your help!

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Activate workbook syntax?

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Activate workbook syntax?

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Registered User
    Join Date
    03-25-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Activate workbook syntax?

    Thank you, this works!

  5. #5
    Registered User
    Join Date
    03-25-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Activate workbook syntax?

    Thank you, this works too!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Activate unsaved workbook from another workbook
    By klallen810 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-17-2013, 12:31 PM
  2. [SOLVED] Change activate workbook to be vba created workbook
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-18-2012, 09:24 AM
  3. Activate Workbook
    By hshayh0rn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-13-2006, 06:10 PM
  4. [SOLVED] Workbook.Activate / Window.Activate problem
    By Tim in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2006, 07:40 PM
  5. Replies: 2
    Last Post: 03-21-2005, 08:06 PM

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