I think this approach is easier for a novice to understand.
Note the texttocolumns function can be used manually from the spreadsheet
The textToColumns can be preset to state what sort of data is in which columns. I have left this on automatic. If it causes a problem you will need to post some data and I (or somone) will help you with that.
Sub testreader()
Dim FileNo As Integer
Dim CurrentLine As String
Dim File As String
Dim Msg As String
Dim i As Integer
Dim bUseLine As Boolean
Dim rng As Range
Dim Filename As String
Filename = "C:\Users\Harskey\Desktop\Book1.csv"
FileNo = FreeFile
Dim lRow As Long
lRow = 2
Set rng = Cells(lRow, 1)
Open Filename For Input As FileNo
For i = 1 To 3 'ignore lines 1-3
Line Input #FileNo, CurrentLine
Next i
bUseLine = True
Do While Not EOF(FileNo)
Line Input #FileNo, CurrentLine
If bUseLine Then 'ie if bUseLine=true
If CurrentLine <> "" Then
Cells(lRow, 1).Value = CurrentLine
End If
lRow = lRow + 1
End If
bUseLine = Not (bUseLine) 'toggles TRUE to FALSE and FALSE to TRUE
Loop
Close #FileNo
Set rng = rng.Resize(lRow - 1) 'minus one less than the start value
rng.TextToColumns Destination:=rng, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, Comma:=True
End Sub
Bookmarks