+ Reply to Thread
Results 1 to 3 of 3

Need help with a Macro that uses VLOOKUP with Application.GetOpenFilename selected file...

  1. #1
    Registered User
    Join Date
    10-31-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    12

    Angry Need help with a Macro that uses VLOOKUP with Application.GetOpenFilename selected file...

    I am writing a macro that will allow the user to select a file.

    Here is the code I have so far


    Please Login or Register  to view this content.

    This part works, but what I want to do is use the variable above "tlx_location_file" as part of a vlookup inside of another file which the following code allows the user to pick...


    Please Login or Register  to view this content.

    Now, here is my problem:

    I'm trying to get the macro to use some form of VLOOKUP, where it takes the values in the file above that is the calton_file and looks them up in 2 columns of the tlx_location_file and returns a value to be stored in the same row of the calton_file, column G.

    I can't get the right syntax - can anyone help? kind of desperate here!

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Need help with a Macro that uses VLOOKUP with Application.GetOpenFilename selected fil

    Well it's hard to give you exact code without more detail (example workbooks showing where the data is and what you want to look up would be helpful) but to use Vlookup in excel you need to define your arguements as ranges, so:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-31-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    12

    Re: Need help with a Macro that uses VLOOKUP with Application.GetOpenFilename selected fil

    Quote Originally Posted by yudlugar View Post
    Well it's hard to give you exact code without more detail (example workbooks showing where the data is and what you want to look up would be helpful) but to use Vlookup in excel you need to define your arguements as ranges, so:
    Please Login or Register  to view this content.
    Thank you - I was able to get it to work a different way. The reason I was having problems was because the "getopenfilename" trick gives the WHOLE filepath in front of the filename itself. This was what was throwing me off.

+ 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. Application "Getopenfilename" copy file and workbook name to pasted file
    By reggie1000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2013, 08:46 AM
  2. How to extract file name from user selected file via Application.FileDialog
    By Jpdatabase in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-09-2012, 04:45 AM
  3. working on a selected file via GetOpenFilename
    By periro16 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2005, 08:52 AM
  4. [SOLVED] [SOLVED] Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)
    By Paul Martin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-05-2005, 12:05 PM
  5. [SOLVED] Application.GetOpenFilename
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2005, 12:06 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