Home > Software engineering >  How to open multiple excel files under the same folder, read from a fixed position data
How to open multiple excel files under the same folder, read from a fixed position data

Time:09-27

A folder, for example, 10 excel file, each excel file sheet2 workbook D2 column data read into a new excel file, the first column is a new excel file excel file name, the second column is the corresponding D2 column data,

If above can be achieved, whether to add some difficulty,

Is each excel file sheet2 data article number is not fixed, can conveniently take to article number (i.e., A1 article number is not null), then write in the third column,

The result of the final presentation was
The name of the table number of D2 article
Tst1. XLS WSYY 10
Tst2. XLS GSDS 15
Tst3. XLS UUIK 23
Tst4. XLS CCSH 76
,,,,,,,,

CodePudding user response:

Use the dir function traversal folder,
Start recording macros in Excel 2003, manual, complete the required function end record macros, press Alt + F11 key, check just record macro corresponding VBA code,
  •  Tags:  
  • VBA
  • Related