View Single Post
 
Old 02-26-2018, 07:26 AM
schor schor is offline Windows 8 Office 2016
Novice
 
Join Date: Feb 2018
Posts: 1
schor is on a distinguished road
Default VBA Sub-Folder Search & Copy Data

I've been doing some research and test-coding in Excel/VBA to get the following task accomplished, however unsuccessful so far. Could anyone please point me towards the right direction how to copy cell values many hundreds of different sensors into a summary file as follows:
Measurement data located in excel-files (two files per sensor) are placed in a (sub-)folder structure as follows: ...\data\sensorSN10\finished\workbookA_SN100.xls + workbookB_SN100.xls ...\data\sensorSN11\finished\workbookA_SN101.xls + workbookB_SN101.xls
In a summary excel (...\data\summaryexcel.xls) I want the VBA script to go through the entire (sub-)folder structure of ...\data\, look if any workbook-data/file is available, copy any (non-empty) cell values C1 of workbookA_SN* to summaryexcel.xls column D1-Dxxx, as well as any (non-empty) cell values B1 of workbookB_SN* to summaryexcel.xls column E1-Exxx.
In an additional column of the summaryexel.xls (C1-Cxxx) I'd like to copy the SN's (=serial numbers) of each sensor (which is given in the filename). How could this be accomplished?
Any help greatly appreciated.
Best
George
Reply With Quote