我有一个excel宏,可将数据从A列导出到文本文件。但是,每次导出时,文本文件中的每一行都以括号符号开头和结尾。通常,我会执行查找和删除操作,但是想使用代码来避免这种情况。
Sub Macro4()
Dim wb As Workbook
Set wb = ActiveWorkbook
Sheets("Concatenate").Columns("A:A").Copy
Workbooks.Add
ActiveSheet.Paste
ActiveWorkbook.SaveAs Filename:= _
wb.Path & "\" & Left(wb.Name, InStr(wb.Name, ".") - 1) & ".txt", _
FileFormat:=xlText, CreateBackup:=False
ActiveWorkbook.Close saveChanges:=True
End Sub