Extract data from specific txt files in folder

angmtz

New Member
Joined
Sep 8, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi does anyone have a VBA that will extract data form only specified txt file in a folder?
Example i have a folder with 100 txt files with names 1.txt 2.txt etc.

I want to extract the data only from 1.txt 3.txt 94.txt

preferably if the vba can read a column with the names of the files i want to extract the data from and extract the data to the next column.

1.txtdata from 1.txt
3.txtdata from 3.txt
94.txtdata from 94.txt
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Welcome to the Board!
We need a few more details.

Where will this list of files to be imported be maintained?
In the same file as the VBA code?

What exactly does your data look like?
Is it just a single field (column) in each file?

What shuld the resulting file be? An Excel file, or a Text file?
If a Text file, how should it be delimited (i.e. space, comma, tab, etc)?
 
Upvote 0

Forum statistics

Threads
1,216,176
Messages
6,129,318
Members
449,501
Latest member
Amriddin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top