vba excel 保存

来源:互联网 发布:知乎 如何取英文名 编辑:程序博客网 时间:2024/06/05 05:09

Sub Macro1()
ActiveWorkbook.SaveAs Filename:="C:/Documents and Settings/renh/桌面/132.txt", _
        FileFormat:=xlText, CreateBackup:=True
End Sub

楼上的看错了吧.人家的数据是在一个单元格里的...
Cells(1,1) & Cells(2,1) & Cells(3,1)   这么连..离题了

 

我试了下用这个可以
str = Replace(str, Chr(10), "")

Sub Macro1()

Dim str As String
str = Range("A1").Value
str = Replace(str, Chr(10), "")
MsgBox str
End Sub