Okay, give the code after my signature a try and see if it does what you
want. I'm not sure if everything will lay out correctly or not. The "fields"
in your posted data seemed to be different from the field widths specified
in the code you posted. I tried adjusting your data to match the field
widths shown in the code for my testing. If it turns out that the data
doesn't lay out correctly, post back the first row of data that gets put
into your worksheet placing each cell's value on a separate line so I can
see how the file is being actually being broken apart. Since the code worked
for you, I'm kind of expecting my subroutine to work also (given that I used
the field widths specified in the code you posted); but, of course, one
never knows. In any event, let me know how this subroutine works out, either
way.
Rick
Sub Import_PTC()
Dim X As Long
Dim Z As Long
Dim P As Long
Dim FileNum As Long
Dim Entry As Variant
Dim FieldWidths As Variant
Dim TotalFile As String
Dim Records() As String
FileNum = FreeFile
FieldWidths = Array(7, 26, 12, 5, 9, 10, 10, 15, 10, 15, 12)
Open "C:\TEMP\EASTPTC.TXT" For Binary As #FileNum
TotalFile = Space(LOF(FileNum))
Get #FileNum, , TotalFile
Close #FileNum
Records = Split(TotalFile, vbCrLf)
With ActiveSheet
For X = 0 To UBound(Records)
P = 1
For Z = LBound(FieldWidths) To UBound(FieldWidths)
Entry = Mid$(Records(X), P, FieldWidths(Z))
If Z - LBound(FieldWidths) = 2 Then
Entry = "'" & Entry
End If
Cells(X + 1, Z + 1 - LBound(FieldWidths)).Value = Entry
P = P + FieldWidths(Z)
Next
Next
End With
End Sub