Hi
So, after searching again, I found here in VBA EXPRESS this code thatis more near to what I want to do. I simply don't know how to set ADDRESS with namedrange ("TECH") to get data filtered by TECH names in col 8.
Option Explicit
'you can extract data from a closed file by using an
'XLM macro. Credit for this technique goes to John
'Walkenback > http://j-walk.com/ss/excel/tips/tip82.htm
Sub GetDataDemo()
Dim FilePath$, Row&, Column&, Address$
'change constants & FilePath below to suit
'***************************************
Const FileName$ = "Closed.xlsx"
Const SheetName$ = "DataList"
Const NumRows& = 100000 'Need to configure range from A1 to last row non blank
Const NumColumns& = 28 'Or setup only cols 1,3,8,24,27
FilePath = ActiveWorkbook.Path & "\"
'***************************************
DoEvents
Application.ScreenUpdating = False
If Dir(FilePath & FileName) = Empty Then
MsgBox "The file " & FileName & " was not found", , "File Doesn't Exist"
Exit Sub
End If
For Row = 1 To NumRows
For Column = 1 To NumColumns
Address = Cells(Row, Column).Address
Cells(Row, Column) = GetData(FilePath, FileName, SheetName, Address)
Columns.AutoFit
Next Column
Next Row
ActiveWindow.DisplayZeros = False
End Sub
Private Function GetData(Path, File, Sheet, Address)
Dim Data$
'Data = "'" & Path & "[" & File & "]" & Sheet & "'!" & _
Range(Address).Range("A1").Address(, , xlR1C1)
Data = "'" & Path & File & "'!" & Address
GetData = ExecuteExcel4Macro(Data)
End Function
I work in Excel 2013 and 2016
Thank you all in advance