using vlookup

  • Hello all!


    I have a template sheet that many people on my team will use with their own data. This data will change everyweek, but sometimes there is a duplicate in the new data from weeks before.


    I have 2 worksheets Not Retained and Worked Accounts. When an account in Not Retained is worked, it automatically gets copied to Worked Accounts. If as an example, next week comes and the new data includes an account previously worked, I would like that row on Not Retained to populate with the notes from column J in Worked Accounts (this will populate in column J in Not Retained as well. This will allow the user a quick glance of accounts already worked so he/she may work those without notes.


    I have searched for how to do this, and usually I try my hand at figuring stuff out, but I cant seem to find anything that does the vlookup function aside from a message box display. I need it to fill the column J on Not Retained for each row that has notes from my Worked Accounts sheet also in column J.


    Any help here would be great...even point me in the direction of some other resource and I can try to give it a go myself.


    Thank you in advance!


    Ken

  • Re: using vlookup


    If you asking for an example of how to do a vlookup there are plenty of them on the web....


    https://exceljet.net/excel-functions/excel-vlookup-function

    http://www.techonthenet.com/excel/formulas/vlookup.php


    http://www.excelfunctions.net/Vlookup-Example-Exact-Match.html


    VLOOKUP( value, table, index_number, [approximate_match] )
    Parameters or Arguments



    value
    The value to search for in the first column of the table.
    table
    Two or more columns of data that is sorted in ascending order.
    index_number
    The column number in table from which the matching value must be returned. The first column is 1.
    approximate_match
    Optional. Enter FALSE to find an exact match. Enter TRUE to find an approximate match. If this parameter is omitted, TRUE is the default.

    Matt Mickle
    Using Excel 2010,2013 & 2016

  • Re: using vlookup


    Thank you for the post...I am not looking for regular vlookup as I understand how it works as a function. I was more specifically looking for how to use it in vba. The tutorials I have found so far are only showing how to use vlookup with vba to produce a result in a message box. I would like to have the result populated in a cell on 1 worksheet from a table on a second worksheet.

  • Re: using vlookup


    What about something like this:

    Code
    1. Sheets("Sheet2").Range("A1") = Application.VLookup("MyValue", "'Sheet1'!$A$2:$D$100", 4, false)

    Matt Mickle
    Using Excel 2010,2013 & 2016