Tab Delimited Text Errors

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hello,

I have in a cell, the following:

<P align=center><IMG alt="" hspace=0
src="images/corsair/gg_corsair.jpg" align=baseline
border=0></P>

upon saving as a tab delimited it gives:

"<P align=center><IMG alt="""" hspace=0
src=""images/corsair/gg_corsair.jpg"" align=baseline
border=0></P>"

the extra quotes are not desired, and I can not figure
out how to eliminate on saving. As I have hundreds of
cells like this, would not be prudent to try to search
for these and eliminate them after conversion.
 
John,

You can try using a macro like the one below. Change the line

FName = "C:\Excel\Export.prn"

to reflect the drive, folder, and name you want to use.

HTH,
Bernie
MS Excel MVP


Sub ExportToFile()

Dim FName As String
Dim WholeLine As String
Dim FNum As Integer
Dim RowNdx As Long
Dim ColNdx As Integer
Dim StartRow As Long
Dim EndRow As Long
Dim StartCol As Integer
Dim EndCol As Integer

FName = "C:\Excel\Export.prn"

Application.ScreenUpdating = False
On Error GoTo EndMacro:
FNum = FreeFile

With Range("A1").CurrentRegion
StartRow = .Cells(1).Row
StartCol = .Cells(1).Column
EndRow = .Cells(.Cells.Count).Row
EndCol = .Cells(.Cells.Count).Column
End With

Open FName For Output Access Write As #FNum

For RowNdx = StartRow To EndRow
WholeLine = ""
For ColNdx = StartCol To EndCol
If WholeLine = "" Then
WholeLine = Cells(RowNdx, ColNdx).Text
Else
WholeLine = WholeLine & "," & Cells(RowNdx, ColNdx).Text
End If
Next ColNdx
Print #FNum, WholeLine
Next RowNdx

EndMacro:
On Error GoTo 0
Application.ScreenUpdating = True
Close #FNum

End Sub
 
Thanks for the reply, I will try that now. Lot of work
to just eliminate quotes!

I have a few other macros I could use a bit of help with,
have them partially written, I am still learning.

Let me know if you could help, for someone with your
skills probably take all of 3 minutes!

John
 
Back
Top