+ Reply to Thread
Results 1 to 10 of 10

Vlookup From External Workbook VBA

  1. #1
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Vlookup From External Workbook VBA

    Hello
    This is cross forum post but due to no response I am posting here Link is Here

    I want to use vlookup from external file = Data and Worksheet = Support
    as I already know how to use vlookup but I do not want to use workbook name and Worksheet name in my formula
    this is the existing formula. Please help me to Write formula without using Workbook name and Worksheet Name in Formula

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Vlookup From External Workbook VBA

    Hi

    You could use something like this..
    Please Login or Register  to view this content.
    The only other way would be to use a Quantum Computer with Telepathic AI that would already know what workbook name and Worksheet name you wanted. That would require Office 2070, but it's not out yet for another fifty years.

    zeddy

  3. #3
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Vlookup From External Workbook VBA

    Hi

    OK, maybe you could just put the lookup source details into another cell, e.g. cell [K1], and then use the INDIRECT method to refer to it..
    Please Login or Register  to view this content.
    zeddy

  4. #4
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Vlookup From External Workbook VBA

    zzzeddy, What if someone changed the file name then how we can handle it , I want that it should be working whatever the filename after the change too

  5. #5
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Vlookup From External Workbook VBA

    Hi

    We would need to know more about the setup.
    Probably the best initial way is to prevent any other User from changing the name of the data file.

    zeddy

  6. #6
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324
    It is impossible to restrict the user to change the filename

  7. #7
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Vlookup From External Workbook VBA

    Hi

    If both workbooks are open in the same Excel session, then any VLOOKUP formula that refers to the other data-workbook would automatically be updated if you changed the sheetname in the other data-workbook, or saved the other data-workbook with a different filename. The VLOOKUP formulas would adjust automatically to show the renamed-filename or renamed-worksheet.

    If you subsequently closed that data-workbook, the formulas in the first workbook would now show the full pathname, filename, and sheetname of the data-workbook.

    If you closed all workbooks and then subsequently renamed your data-workbook using the file explorer, then VLOOKUP formulas would not 'know' what the new filename is.

    zeddy

  8. #8
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Vlookup From External Workbook VBA

    Agree with your explanation, but consider the scenario that in vb code we have fixed the filename , on the otherday someone changed the filename from folder then

  9. #9
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Vlookup From External Workbook VBA

    Hi

    Yes. Same problem would arise if someone just moved the data-workbook to another folder-location. Or just deleted it.

    You can deal with issues like this in vba, for example you could have code that checks for the existence of a specific file in a specified location, and display an appropriate message.

    If you explain a little more detail of your setup, we could help more.

    zeddy

  10. #10
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Vlookup From External Workbook VBA

    I do not want to force the user to rename the workbook
    Setup is very I am looking from my main workbook(Data) which have vb code and the other workbook is already open and I am inputting vlookup in it

+ 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. Access external Excel workbook from within another workbook via VBA with VLOOKUP
    By Josh2015 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-09-2015, 11:08 AM
  2. Vlookup in external workbook over multiple sheets
    By rodgersmg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-11-2014, 05:20 AM
  3. get last row of external workbook for vlookup
    By lday75 in forum Excel General
    Replies: 6
    Last Post: 07-10-2012, 10:29 AM
  4. (Should be) Simple vlookup to external workbook
    By benolsen in forum Excel General
    Replies: 7
    Last Post: 02-13-2012, 02:29 PM
  5. VLOOKUP to external workbook
    By Dan17602 in forum Excel General
    Replies: 6
    Last Post: 03-22-2011, 03:07 PM
  6. Vlookup External Workbook with Password
    By bcelestia in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-24-2007, 09:01 AM
  7. VLookup to an external Workbook
    By don in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 11-17-2005, 01:35 PM

Tags for this Thread

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