Hi
I have question , is there any properties to select folder to pull data from multiple files for the same sheet and the same range instead of using select file individually as the current code does it?
Sub get_data1()
Dim lRw As Long
Dim OUTrng As Range
' get last row number in column B
lRw = ThisWorkbook.Sheets("sheet1").Cells(Rows.Count, 2).End(xlUp).Row
With Application.FileDialog(msoFileDialogFilePicker)
.Show
With GetObject(.SelectedItems(1))
Set OUTrng = .Sheets(5).Range("g2:i1000")
With OUTrng
Set OUTrng = OUTrng.Resize(.Rows.Count, .Columns.Count + 1)
End With
Application.DisplayAlerts = False
With OUTrng
.Resize(.Rows.Count, .Columns.Count - 1).SpecialCells(xlCellTypeVisible).Copy
End With
' close file without saving
.Close 0
Application.DisplayAlerts = True
' paste to bottom of row B but don't use helper column
ThisWorkbook.Sheets("sheet1").Cells(lRw + 1, 2).PasteSpecial
End With
End With
I hope my question is clear.