close

When I use the Substitute function on a text string, and then save as a Tab
Delimited File, I get Quotations Marks at the beginnig and end of the cell
results. I don't want them.

They don't appear in Excel, but they are in the resulting file.

Check out:
exceltips.vitalnews.com/Pages...ext_Files.html

quot;Donquot; wrote:

gt; When I use the Substitute function on a text string, and then save as a Tab
gt; Delimited File, I get Quotations Marks at the beginnig and end of the cell
gt; results. I don't want them.
gt;
gt; They don't appear in Excel, but they are in the resulting file.

Thanks for this. I had seen this, but really don't understand it.

I've been playing with this most of the night and early this morning, and it
ONLY happens when I substitute a comma. If I substitute some other
character, like an x, then it comes out fine. Problem is, the system I'm
trying to create the file for requires a comman, and I can't change that!

Thanks for your help. Any other ideas?

Don

quot;Nick Bquot; wrote:

gt; Check out:
gt; exceltips.vitalnews.com/Pages...ext_Files.html
gt;
gt; quot;Donquot; wrote:
gt;
gt; gt; When I use the Substitute function on a text string, and then save as a Tab
gt; gt; Delimited File, I get Quotations Marks at the beginnig and end of the cell
gt; gt; results. I don't want them.
gt; gt;
gt; gt; They don't appear in Excel, but they are in the resulting file.

Well, it sounds like you are stuck. According to the article, you have two
options:
1) Open the file in another program (i.e. Notepad, Word, Wordpad) and search
for the quotation marks and replace them with nothing, to get rid of them
after saving the file from Excel.
2) Create a macro by going to Tools-gt;Macro-gt;Macros-gt;Record New Macro, select
Personal Macros Workbook, click OK to start recording. Then click on a
different cell (any cell) and click on the Stop Recording button that is
floating arround. Then go to Window-gt;Unhide, select Personal.xls and click
OK/Unhide. Then go to Tools-gt;Macro-gt;Macros, higlight the new macro and click
Edit. This will take you to its code. Highlight everything between the line
that reads quot;Sub Macro1quot; (or whatever the macro name is) and quot;End Subquot;. Delete
the text and paste in:
Sub Export()
Dim r As Range, c As Range
Dim sTemp As String

Open quot;c:\MyOutput.txtquot; For Output As #1
For Each r In Selection.Rows
sTemp = quot;quot;
For Each c In r.Cells
sTemp = sTemp amp; c.Text amp; Chr(9)
Next c

'Get rid of trailing tabs
While Right(sTemp, 1) = Chr(9)
sTemp = Left(sTemp, Len(sTemp) - 1)
Wend
Print #1, sTemp
Next r
Close #1
End Sub

Change the quot;c:\MyOutput.txtquot; to be the path and file name that you want to
save to. Then go to File-gt;Close and Return to Microsoft Excel. Then go to
Window-gt;Hide. Then cells you want to save and go to Tools-gt;Macro-gt;Macros,
highlight the macro and click Run.

This could be modified to export all cells and to use a button, but this
should hopefully get you started.

Help any?quot;Donquot; wrote:

gt; Thanks for this. I had seen this, but really don't understand it.
gt;
gt; I've been playing with this most of the night and early this morning, and it
gt; ONLY happens when I substitute a comma. If I substitute some other
gt; character, like an x, then it comes out fine. Problem is, the system I'm
gt; trying to create the file for requires a comman, and I can't change that!
gt;
gt; Thanks for your help. Any other ideas?
gt;
gt; Don
gt;
gt; quot;Nick Bquot; wrote:
gt;
gt; gt; Check out:
gt; gt; exceltips.vitalnews.com/Pages...ext_Files.html
gt; gt;
gt; gt; quot;Donquot; wrote:
gt; gt;
gt; gt; gt; When I use the Substitute function on a text string, and then save as a Tab
gt; gt; gt; Delimited File, I get Quotations Marks at the beginnig and end of the cell
gt; gt; gt; results. I don't want them.
gt; gt; gt;
gt; gt; gt; They don't appear in Excel, but they are in the resulting file.

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()