+ Reply to Thread
Results 1 to 3 of 3

VBA Vlookup using variables

  1. #1
    Forum Contributor
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    180

    VBA Vlookup using variables

    Hi there,

    I am trying to use variables within a vlookup in vba. The code i am trying to amend is:-
    Please Login or Register  to view this content.
    I tried to amend as so but no luck:-

    Please Login or Register  to view this content.
    Any help would be much appreciated.

    Kind regards,

    forrestgump

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: VBA Vlookup using variables

    Hi forrest

    try this instead...

    Please Login or Register  to view this content.
    since y and x are variables, you need to have them outside the quotes so that their value gets picked up, instead of literally the text "x" or "y"
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: VBA Vlookup using variables

    Thanks Arkadi! That works great!

+ 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. VLookup two Variables
    By domnicmifsud in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-15-2016, 09:37 AM
  2. [SOLVED] vlookup with variables
    By vio.coman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2015, 09:26 AM
  3. Vlookup with 2 variables
    By Armitage2k in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-21-2014, 03:13 AM
  4. [SOLVED] vlookup with 3 different variables
    By a2424 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-26-2014, 01:51 AM
  5. vlookup against various variables
    By papah73 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-25-2014, 06:36 AM
  6. [SOLVED] Vlookup two variables
    By PERE in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-28-2013, 06:36 AM
  7. [SOLVED] Can I identify variables using VLOOKUP, and then pass variable to another VLOOKUP?
    By Jeff C in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-05-2012, 05:54 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