mikke3141
12-23-2014, 04:42 AM
Hello,
I'm trying to load the attached text file to excel, but the special character (c in the word Baco) creates a line break. What to do?
Sub loadit()Dim i As Integer
Dim pos As Integer
Dim ffile As String
Dim ffile2 As String
se = "C:\Users\" & Environ("USERNAME") & "\Desktop"
ffile = se & "\source.csv" 'your source file
ffile2 = se & "\ready.xls" 'your destination file
Dim vstring As String
Dim a As Variant
Dim b As Integer
Open ffile For Input As #1
Open ffile2 For Output As #2
Do While Not (EOF(1))
Line Input #1, vstring
If Not (vstring = "") Then
vstring = Replace(vstring, vbTab, ";")
Write #2, vstring
End If
Loop
Close #1
Close #2
End Sub
I'm trying to load the attached text file to excel, but the special character (c in the word Baco) creates a line break. What to do?
Sub loadit()Dim i As Integer
Dim pos As Integer
Dim ffile As String
Dim ffile2 As String
se = "C:\Users\" & Environ("USERNAME") & "\Desktop"
ffile = se & "\source.csv" 'your source file
ffile2 = se & "\ready.xls" 'your destination file
Dim vstring As String
Dim a As Variant
Dim b As Integer
Open ffile For Input As #1
Open ffile2 For Output As #2
Do While Not (EOF(1))
Line Input #1, vstring
If Not (vstring = "") Then
vstring = Replace(vstring, vbTab, ";")
Write #2, vstring
End If
Loop
Close #1
Close #2
End Sub