excel vba 如何当前工作表保存在当前目录下,格式为为txt 5
6个回答
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Sub 激活工作表存为txt()
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\ " & ActiveSheet.Name & ".txt", FileFormat:= _
xlText, CreateBackup:=False
End Sub
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\ " & ActiveSheet.Name & ".txt", FileFormat:= _
xlText, CreateBackup:=False
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Sub 导出文本文件()
Dim Fname As String
Fname = ActiveWorkbook.Path
If Right(Fname, 1) <> "\" Then Fname = Fname & "\"
ActiveWorkbook.SaveAs Filename:=Fname & "123.txt", FileFormat:=xlText, CreateBackup:=False
ActiveWorkbook.Saved = True
ActiveWindow.Close
End Sub
Dim Fname As String
Fname = ActiveWorkbook.Path
If Right(Fname, 1) <> "\" Then Fname = Fname & "\"
ActiveWorkbook.SaveAs Filename:=Fname & "123.txt", FileFormat:=xlText, CreateBackup:=False
ActiveWorkbook.Saved = True
ActiveWindow.Close
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Sub SaveAsWork()
ThisWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\123.txt"
End Sub
ThisWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\123.txt"
End Sub
追问
只保存当前工作表,不是整个工作簿啊?而且这样保存就是乱码了
追答
但是你打开的时候用EXCEL打开就是原始数据,不会是乱码。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询