excel vba vlookup
Sub vlookup1()
Dim student_id As Long
Dim marks As Long
student_id = 11004
Set myrange = Range(“B4:D8”)
marks = Application.WorksheetFunction.VLookup(student_id, myrange, 3, False)
End Sub
excel vba vlookup
Sub vlookup1()
Dim student_id As Long
Dim marks As Long
student_id = 11004
Set myrange = Range(“B4:D8”)
marks = Application.WorksheetFunction.VLookup(student_id, myrange, 3, False)
End Sub
vba code to vlookup from another workbook
Sub test()
Application.ScreenUpdating = False
Dim sw As Workbook
Dim dw As Workbook
Dim srng As Range
swname$ = "BB_Finacle ID-Mar'19.xlsb"
swpath$ = ThisWorkbook.Path & "" & swname
Set dw = ThisWorkbook
c& = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
Workbooks.Open (swpath)
Set sw = Workbooks(swname)
Set srng = sw.Sheets(1).Range("B:R")
Sheet1.Range("B2:B" & c).Formula = "=VLookup(A2,[BB_Finacle ID-Mar'19.xlsb]SHEET1!" & srng.Address & ", 3, False)"
Sheet1.Range("B2:B" & c).Copy
Sheet1.Range("B2").PasteSpecial xlValues
Application.CutCopyMode = False
sw.Close
Application.ScreenUpdating = True
End Sub
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us