+ Reply to Thread
Results 1 to 4 of 4

VLookup is choosing values from other lines

  1. #1
    Registered User
    Join Date
    07-26-2016
    Location
    Alberta, Canada
    MS-Off Ver
    2013
    Posts
    4

    VLookup is choosing values from other lines

    Worksheets("Tables and Calcs").Cells(i + 126, 11).Value = Application.VLookup("MBH", Worksheets("Tables and Calcs").Range("B117:DY120"), Application.Match(Worksheets("Tables and Calcs").Cells(i + 126, 4), Worksheets("Tables and Calcs").Range("B117:DY117"), 0))

    Worksheets("Tables and Calcs").Cells(i + 126, 13).Value = Application.VLookup("GPM", Worksheets("Tables and Calcs").Range("B117:DY120"), Application.Match(Worksheets("Tables and Calcs").Cells(i + 126, 4), Worksheets("Tables and Calcs").Range("B117:DY117"), 0))

    Worksheets("Tables and Calcs").Cells(i + 126, 15).Value = Application.VLookup("WPD", Worksheets("Tables and Calcs").Range("B117:DY120"), Application.Match(Worksheets("Tables and Calcs").Cells(i + 126, 4), Worksheets("Tables and Calcs").Range("B117:DY117"), 0))


    When I run this, the "WPD" line is giving the same values as the "MBH" line, and only 2 of the 3 lines will work correctly at any time, in any order...

    Any idea what might be going on here?

  2. #2
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: VLookup is choosing values from other lines

    Very difficult with what you have provided!

    I think you need to change ,0)) at the end to ,0),0)

    I think you are missing the range lookup operator for the vlookup.

    I hope this helps, please let me know!

    Regards,

    David


    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  3. #3
    Registered User
    Join Date
    07-26-2016
    Location
    Alberta, Canada
    MS-Off Ver
    2013
    Posts
    4

    Re: VLookup is choosing values from other lines

    That seems to have fixed it!

    Thank you very much!

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: VLookup is choosing values from other lines

    You're welcome!

    Regards,

    David


    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


+ 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. Choosing a Variable col_index_num in VLOOKUP
    By esohn92 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2015, 04:33 PM
  2. Choosing specific cells from lines in different lengths
    By atakantekel in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 01-30-2015, 05:09 PM
  3. Choosing 3 or more values
    By Jekser in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2012, 08:08 PM
  4. Choosing workbook for vlookup based on cell value
    By anandvh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2012, 01:33 PM
  5. Choosing values from table
    By turbosax2 in forum Excel General
    Replies: 18
    Last Post: 05-28-2011, 05:06 AM
  6. Choosing what lines you want to show in a line graph
    By dandavis1 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-24-2010, 06:05 AM
  7. Choosing cells dependant on values
    By richgw in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-18-2007, 12:02 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