+ Reply to Thread
Results 1 to 1 of 1

Calling External Worksheet and Setting Variable for Active Workbook

  1. #1
    Registered User
    Join Date
    04-25-2014
    Location
    NYC, NY
    MS-Off Ver
    Excel 2010
    Posts
    44

    Calling External Worksheet and Setting Variable for Active Workbook

    I have this following code:

    Please Login or Register  to view this content.
    I am using VLookup to pull data from an external workbook called "CONTROL SHEET" into my workbook called "TEST FILE". The macro will be run individually on files so the file name will keep needing to change. I tried assigning a variable to call my workbook, but when I tried setting a variable to ActiveWorkbook, it didn't work. How would I correct this so that if the file name changes, I can still pull the data.

    EDIT 1: I was able to resolve the issue below. I just had to remove the [ in front of the N, and add the [ before CONTROL. I still need help with the above.

    Also, I currently need to have the "CONTROL SHEET" book open in order to run the macro. If it isn't, it asks me where the file is located. The file is located on a shared drive so if I could link to that instead, that would be awesome.

    I tried this:

    Please Login or Register  to view this content.
    but in the actual workbook, the formula shows up something like: (I changed the name of the drives) The last letter of CONTROL gets cut off (it was a longer word so maybe it was too long?).
    Please Login or Register  to view this content.
    EDIT2: Solved first problem. I noticed that I could delete
    Please Login or Register  to view this content.
    and still have it work.
    Last edited by jhuang5132; 08-15-2014 at 05:54 PM.

+ 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] Setting a Public Variable = the Active Cell
    By slm10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2014, 07:56 AM
  2. Replies: 4
    Last Post: 12-01-2013, 03:22 AM
  3. Calling named range from external workbook
    By Phraedrique in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2009, 06:36 PM
  4. calling external application & returning back to activate excel workbook
    By darius.chong in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-08-2009, 10:23 PM
  5. Calling Formas and macros in an external workbook
    By TerryTee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2007, 11:40 AM

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