one way that I can think of is to read the first line through a string variable with a function. One such function would be something like:
Code:
Function TxtReadLn(wPath As String, _
Optional lnNum As Long)
'******************************************************************************
' *
'Author: Adam Evanovich *
'Date: 6/12/2006 *
'Purpose: Reads a single line of text from a text file. *
' *
'Arguments: *
'wPath > Full path of the text file being read. *
'lnNum > The line number to read. If omitted, the first line of text will *
' be read. If invalid, it returns and error. *
' *
'******************************************************************************
On Error GoTo Err_Handle
Const wMode = 1& 'Read Only Mode - Long Value
Dim ctr As Long
Dim fso As Object
Dim oFile As Object
Dim tStream As Object
ctr = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set oFile = fso.GetFile(wPath)
Set tStream = oFile.OpenAsTextStream(wMode)
If lnNum > 0 Then
On Error GoTo Err_Handle_EOS
Do While ctr < lnNum
tStream.SkipLine
ctr = ctr + 1
Loop
End If
On Error GoTo Err_Handle
TxtReadLn = tStream.ReadLine
tStream.Close
Set fso = Nothing
Set oFile = Nothing
Set tStream = Nothing
Exit Function
Err_Handle:
If Err.Number = 53 Then
MsgBox "There is no file to read..."
End If
Set fso = Nothing
Set oFile = Nothing
Set tStream = Nothing
Err_Handle_EOS:
MsgBox "Line number is invalid..."
Set fso = Nothing
Set oFile = Nothing
Set tStream = Nothing
End Function
You could also import the txt using code, then append the first row however you need it. that would take a lot less code too.