我目前有以下代码将电子表格另存为.txt文件。
Sub Macro1()
'Saves the Activesheet to the Desktop as a text file with a different extension
Dim newFile As String, fName As String, gName, fileSaveName
gName = "FGM_"
fName = Range("A2").Value
newFile = gName & " " & fName & " " & Format$(Date, "dd-mm-yyyy")
fileSaveName = Application.GetSaveAsFilename(newFile, "Text (MS-DOS) (*.txt), *.txt")
ThisWorkbook.SaveAs fileSaveName, xlTextMSDOS
End Sub
但是,我只想保存个特定列,并将它们转换为.txt文件。