Hi there,
I have this formula in VBA to get data from at closed Workbook.
mydata = 'H:\Orders\501 Mor\139 LWD\08 Documentation\[501.139 Monte Tidsplan.xlsm]Gantt'!B6:B25
Right now a part of my VBA look like this:
Code
Path = "='H:\Orders\" 'Path to the file
Path_1 = Cells(37, 2) & "\" 'Folder name "501 Mor"
Path_2 = Cells(38, 2) & "\" 'Folder name"139 LWD"
Path_3 = "08 Documentation\" 'folder in the Path
File_1 = "[" & Cells(1, 2) 'Start of Workbook name "501.139 Monte"
File_2 = " Tidsplan.xlsm]Gantt'!" 'End of workbook name
cel = "B6:B25" 'Cells where data shall be take from
mydata = Path & Path_1 & Path_2 & Path_3 & File_1 & File_2 & cel 'Path and Workbook name and Cells
What I would like is that Path_ 1 will be "501" and then Wildcard. And Path_ 2 will be "139" and then Wildcard. So the code will look like this:
Code
Path = "='H:\Orders\" 'Path to the file
Path_1 = Cells(37, 2) & "\" 'Folder name "501"
Path_2 = Cells(38, 2) & "\" 'Folder name "139"
Path_3 = "08 Documentation\" 'Folder in the Path
File_1 = "[" & Cells(1, 2) 'Start of Workbook name "501.139 Monte"
File_2 = " Tidsplan.xlsm]Gantt'!" 'End of workbook name
cel = "B6:B25" 'Cells where data shall be take from
mydata = Path & Path_1 & "*" & Path_2 & "*" & Path_3 & File_1 & File_2 & cel 'Path and Workbook name and Cells
I hope this make sense, if not then please tell me.
Thank you in advance for all your time and help.
Alring