I have a excel sheet which has data in column A.There are many special characters in the cells.When I save the sheet in .txt format I get inverted commas at the start of each line. I tried both manually and by macro saving the file in .txt format.Why is it so? How to remove them?
I am not able to remove the quotes.
Attaching a pic ![enter image description here](https://i.stack.imgur.com/VSCBh.jpg)
我看到这个问题已经得到解答,但想提供一个替代方案,以防其他人稍后发现这个问题。
根据所需的分隔符,可以执行此操作无需编写任何代码。最初的问题没有提供有关所需输出类型的详细信息,但这里有一个替代方案:
PRN 文件类型
最简单的选项是将文件保存为“格式化文本(空格分隔)”类型。
VBA 代码行类似于以下内容:
ActiveWorkbook.SaveAs FileName:=myFileName, FileFormat:=xlTextPrinter, CreateBackup:=False
在 Excel 2007 中,这会令人烦恼地在文件名末尾添加 .prn 文件扩展名,但可以通过手动重命名将其更改为 .txt。
在 Excel 2010 中,您可以在“另存为”对话框中指定所需的任何文件扩展名。
需要注意的一件重要事情是:文本文件中使用的分隔符数量与 Excel 列的宽度有关。
Observe:
![Excel Screenshot](https://i.stack.imgur.com/HvXCg.png)
Becomes:
![Text Screenshot](https://i.stack.imgur.com/LjWcC.png)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)