Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
looping through text files in a folder
Hi
I recently had help in reading the next line of a text file but I am now having problems in looping through and reading and extracting information in all of the text files in a specific folder. The previous help was in reading and extracting on a specific file but i can't seem to get the looping to work. Can anyone help me please? Below is the title of my previous discussion. Frederic Read the next line in a text file http://www.microsoft.com/communities...a= wsignin1.0 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
looping through text files in a folder
The untested code below should read through all text files in the
specified directory Dim strFile As String 'Get first file strFile = Dir("C:\MyFolder\*.txt") 'Begin Processing Do While Not Trim(strFile) = "" 'Insert file proccessing here . . . . . . 'Get Next File strFile = Dir() Loop Goshute |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
looping through text files in a folder
thank you for the quick reply. It works perfectly Frederic. "goshute" wrote: The untested code below should read through all text files in the specified directory Dim strFile As String 'Get first file strFile = Dir("C:\MyFolder\*.txt") 'Begin Processing Do While Not Trim(strFile) = "" 'Insert file proccessing here . . . . . . 'Get Next File strFile = Dir() Loop Goshute . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automating import of several text files from specified folder | Excel Programming | |||
Open all Text files in a folder | Excel Programming | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) | |||
Searching through the contents of a Folder of text files | Excel Programming | |||
Looping through files in a folder | Excel Programming |