+ Reply to Thread
Results 1 to 3 of 3

Using filename in VLOOKUP

  1. #1
    Registered User
    Join Date
    07-12-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    77

    Using filename in VLOOKUP

    Hi everybody,

    I am trying to enter a vlookup to a closed file, and to save me changing the path name in the code each month would like to refer to it using a string.

    I have tried:

    Public PreviousMonth As String
    PreviousMonth = "F:\Global Finance\Financial Reporting\Financial Reports\02 May 13\Data & Other Downloads\Debtors\[DEBTORS 31.05.13 Final.xlsx]DEBTORS 31.05.13"

    Range(Cells(2, 75), Cells(ODRows, 75)).Formula = "=IFERROR(VLOOKUP(A:A,PreviousMonth!$A:$CD,48,0),""NEW"")"

    ...but I think there is a problem with my syntax.

    Does anyone have any suggestions?

    Also, as there are about 200k lookups to do this really slows the code up, is there a better way to apply a vlookup in vba?

    Many thanks

    Rich

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646
    Rich

    Wouldn't it be easier/quicker to have code that opens the workbook and retrieves the values you want?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-12-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Using filename in VLOOKUP

    Thanks Norie, I'm still trying to figure that one out, using concatenation to update the name of the file to be opened.

    Would you still use a vlookup when you've opened the file?

    - I tried to respond on Friday but the messages weren't going through.

+ 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. Variable filename in vlookup
    By Lizzietish11 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-19-2016, 08:30 AM
  2. Using vraible Filename in VLOOKUP
    By ats1312 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-02-2013, 07:07 AM
  3. vlookup to different filename created by time
    By cihow81 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-12-2012, 05:49 AM
  4. Replies: 3
    Last Post: 07-09-2012, 03:09 PM
  5. Vlookup From filename with dynamic date?
    By kennethA in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-09-2008, 05:30 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