Search

VLOOKUP using VBA. VBA and Excel WorkSheet Functions

Like what I do? Donate
Did I help you? Did one of my tutorials save you sometime? 
You can say thank you by buying me a cup of coffee, I go through a lot of it.
Help keep Greater Good resources free for everyone. Please donate today. 




This page is not monitored so for questions please comment on the youtube video page. For suggestions email vbaa2z.team@gmail.com

Download project or source code from below link(s)

Option Explicit

Sub vlookuptest1()
    Range("B2:B501").FormulaR1C1 = "=VLOOKUP(RC[-1],Data!R1C1:R501C13,2,0)"
End Sub

Sub vlookuptest2()
    Range("B2:B501").Formula = "=VLOOKUP(A2,Data!$A$1:$M$501,2,0)"
End Sub


Sub vlookuptest2()
    
'-----------------------------
'Thanks for downloading the code. 
'Please visit our channel for a quick explainer on this code.
'Feel free to update the code as per your need and also share with your friends.
'Channel: Youtube.com/vbaa2z
'Download free codes from http://vbaa2z.blogspot.com
'Autor: L Pamai (vbaa2z.team@gmail.com)
'-----------------------------

    Dim myuidstr As String
    Dim firstNameStr As String
    
    myuidstr = "1000006"
    
    firstNameStr = Application.WorksheetFunction.VLookup(myuidstr, Sheets("Data").Range("A1:M501"), 2, 0)
    
    MsgBox firstNameStr
    
End Sub

No comments:

Post a Comment

Note: only a member of this blog may post a comment.