Transferring of multiple column values from one excel sheet to another excel sheet

vba method:
the logic is simple, just fill in vlookup formula in the first row and drag it all the way down, it takes an instant to fill in 3000 rows:

Steps

  1. copy this code to vba.txt (same folder as your project)
Function Macro1()
    
    ActiveWorkbook.Sheets("WorkingSheet").Activate

    Range("C2").Formula = "=VLOOKUP($B2, SourceSheet!$A:$D, 2, FALSE)"
    Range("D2").Formula = "=VLOOKUP($B2, SourceSheet!$A:$D, 3, FALSE)"
    Range("E2").Formula = "=VLOOKUP($B2, SourceSheet!$A:$D, 4, FALSE)"
    Range("C2:E2").Select
    Selection.AutoFill Destination:=Range("C2:E" & Cells(Rows.Count, 1).End(xlUp).Row) 
    ActiveWorkbook.Save
End Function
  1. use this sequence to call the vba function on your excel
    Sequence1.xaml (5.3 KB)

result

NOTE
if you get this error
image
you need to enable trust access (just do this once)

2 Likes