Happy New Year Forum!

This is my first post of the New Year. I seem to be having a hard time figuring out how to read a text file and import the second line of data into a spreadsheet. I have thousands of files that need to be opened and have the second line extracted. I want to point the code to a directory with the files and have the second line of data imported into a spreadsheet. Heres how i have started the code:


Dim MyPath As String
Dim FilesInPath As String
Dim MyFiles() As String
Dim Fnum As Long
Dim mybook As Workbook
Dim basebook As Workbook
Dim FileName As String



'Declare the place for the excel workbook

Dim myExcelPathFull As String
myExcelPathFull = ActiveWorkbook.Path

'Application.Visible = False


Application.ScreenUpdating = False

'Fill in the path\folder where the files are on your machine

MyPath = InputBox("Paste Address", "Directory Location")

'Add a slash at the end if the user forgets it

If Right(MyPath, 1) <> "\" Then
MyPath = MyPath & "\"
End If

'If there are no .txt files in the folder exit the sub
FilesInPath = Dir(MyPath & "*.txt")
If FilesInPath = "" Then
MsgBox "No files found"
Exit Sub
End If

On Error GoTo CleanUp

Set basebook = ThisWorkbook


'Fill the array(myFiles)with the list of text files in the folder
Fnum = 0
Do While FilesInPath <> ""
Fnum = Fnum + 1
ReDim Preserve MyFiles(1 To Fnum)
MyFiles(Fnum) = FilesInPath
FilesInPath = Dir()
Loop


'Loop through all files in the array(myFiles)
If Fnum > 0 Then
For Fnum = LBound(MyFiles) To UBound(MyFiles)
Set mybook = Workbooks.Open(MyPath & MyFiles(Fnum))
This code will identify if the files in the given directroy exist and will count the amount of files that need to be opened. Any suggestion on how have it loop through the files and read the second line of text.


Thanks,


Dubbdan