What is a Vlookup?

What is a Vlookup?

Vlookup is a function built into Excel that is created to process data that is organized in columns or (short for ‘vertical lookup’). For the value specified, the function will provide the corresponding value from another column in the same row.

Vlookup Example

I have a table of cryptocurrencies that I would like to lookup name for based upon the symbol.

Syntax

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

lookup_value – the value being searched for

table_array – the data that is being searched for the lookup_value, Note: the left-most column of the array is searched by the Vlookup function

col_index_num – An integer, specifying the column number that you would like to return a value from.

[range_lookup] – Optional logical argument that describes what should be returned by the function in the event that it is unable to locate the lookup_value.

Code:

Private Sub Worksheet_Change(ByVal Target As Range)

Dim result As String
Dim sheet As Worksheet
Set sheet = ActiveWorkbook.Sheets(“Sheet1”)
result = Application.WorksheetFunction.VLookup(sheet.Range(“M2”), sheet.Range(“A2:J101”), 2, False)
ActiveWorkbook.Sheets(“Sheet1”).Range(“N2”) = result

End Sub

Video:

 

Please follow and like us:

Author: admin2344

Leave a Reply