+ Reply to Thread
Results 1 to 5 of 5

Dynamic column vlookup

  1. #1
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Dynamic column vlookup

    How do you pass a variable into a vlookup function? I have no idea how many columns are I need to comb through so I need the column range to be dynamic

    Please Login or Register  to view this content.
    I wanna pass this into a vlookup for the column range so that its always the last column in the region

  2. #2
    Registered User
    Join Date
    02-23-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    39

    Re: Dynamic column vlookup

    Does it specifically need to be VBA?

    If you wanted to do this via formula a way would be to create a table (lets just say you called it Table1)

    Put this formula into a random cell (lets just say Z10) - =COLUMNS(Table1)

    This should return the total number of columns,

    Then, set up a cell to type your search criteria (lets just say Z11).

    Now if you always want to use the final column, your vlookup would be: = Vlookup(Z11,Table1,Z10,False).

  3. #3
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Re: Dynamic column vlookup

    Can you use the columns formula for a pivottable?

  4. #4
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Re: Dynamic column vlookup

    Oh wait you just gave me a great idea THANK YOU!!!!

  5. #5
    Registered User
    Join Date
    02-23-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    39

    Re: Dynamic column vlookup

    You're welcome!

+ 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. Replies: 1
    Last Post: 01-30-2015, 01:02 PM
  2. [SOLVED] Dynamic search; using column # result to determine column used for column/row match.
    By David Brunk in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-18-2014, 09:57 PM
  3. a Dynamic Vlookup (Column Reference)
    By SunOffice in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-27-2013, 04:27 PM
  4. Dynamic Range Column Chart w/ Dynamic Avg Line (Excel 2007)
    By BrokenBiker in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-04-2012, 11:40 AM
  5. Replies: 0
    Last Post: 02-28-2006, 09:10 PM
  6. Replies: 0
    Last Post: 02-28-2006, 09:10 PM
  7. Replies: 0
    Last Post: 02-28-2006, 09:10 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