vlookup across multiple workbooks

CamVilla

New Member
Joined
Feb 8, 2021
Messages
21
Office Version
  1. 2019
Platform
  1. Windows
Hi, can someone help me. I need to vlookup across multple worksheets but I can't do it.

Sub Macro2()
Sheets("BASE").Select
Range("G13").Select
ActiveCell.FormulaR1C1 = _
"=+VLOOKUP(RC1,[C41.xls]Hoja1!R13:R65536,+COLUMN([C41.xls]Hoja1!R[1]C),FALSE)"
Range("G13").Select
Selection.AutoFill Destination:=Range("G13:JK13"), Type:=xlFillDefault
Range("G13:JK13").Select
Selection.AutoFill Destination:=Range("G13:JK243"), Type:=xlFillDefault
Range("G13:JK243").Select
End Sub

Instead of puting the file name (in this case C41), I would like to loop through files in a folder, is this possible?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,223,632
Messages
6,173,469
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top