Answers for "vlookup vba from another workbook"

VBA
0

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
Posted by: Guest on September-21-2020

Code answers related to "vlookup vba from another workbook"

Code answers related to "VBA"

Browse Popular Code Answers by Language