+ Reply to Thread
Results 1 to 5 of 5

Vlookup from other file

  1. #1
    Registered User
    Join Date
    04-22-2022
    Location
    Karlsruhe, Germany
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Vlookup from other file

    Hello all,

    I am currently trying to write a VBA-Code, which should use a Vlookup to get specific data from another workbook. (The column from which it should take the data should be flexible based on the month, which is why I implemented "ZielSpalte")
    By now, I have the following code:

    Please Login or Register  to view this content.
    Everything works as it should be (Opening the source file and get lr/ii) until the red line at the end, here VBA is showing the error "Application-defined or object-defined error".
    In the original code, I have defined the range of the Vlookup with variables (SourceBlatt/SourceFile), as this was not working I now even used the actual file names, but there still seems to be a problem.

    Any hints from your side would be highly appreciated.
    Thank you very much in advance!

    BR

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,784

    Re: Vlookup from other file

    File "MBR-02AA_Ressources_Plants_2022_BaPAA_20220503_1500.xlsx" must be open for this to work and I see nothing in your code that opens that file. Further you define the variable wbkSource but it is never again referenced.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-22-2022
    Location
    Karlsruhe, Germany
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Re: Vlookup from other file

    The file is open, but still does not seem to work. The file is getting opened by "Workbooks.Open (SourceFile) and this part of the code works perfectly fine, just the line with the Vlookup does not seem to work for some reason. You are right with the variable, I will delete it.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,784

    Re: Vlookup from other file

    Please Login or Register  to view this content.
    Is that not your real code?

  5. #5
    Registered User
    Join Date
    04-22-2022
    Location
    Karlsruhe, Germany
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Re: Vlookup from other file

    Instead of "Link to Sharepont", it is an actual link to the file, I should have made that clear in my comment

+ 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. Combine or vlookup from multiple file to master file
    By avijitsarkar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2021, 12:28 PM
  2. Replies: 1
    Last Post: 03-12-2019, 04:32 PM
  3. [SOLVED] Import data from .XLS, xlsx file into .xlsm file and do vlookup
    By pacificepoc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2018, 01:32 AM
  4. [SOLVED] Import .xls file in .xlsm file using macro and vlookup the sheets in new sheets
    By pacificepoc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2018, 04:06 AM
  5. VBA - User Prompted to choose source file for Vlookup, Error after file is opened
    By gcxp97 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-08-2016, 06:11 PM
  6. Vlookup, vlookup in external web Excel file
    By G.Bregvadze in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-15-2013, 02:10 AM
  7. Opening latest version of file and then doing vlookup in that file
    By Dan.carpe@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 12-11-2012, 12:43 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