Excel VBA如何新建一个txt文档,并记录一些东西
答案:1 悬赏:30 手机版
解决时间 2021-03-21 21:27
- 提问者网友:未信
- 2021-03-21 05:25
Excel VBA如何新建一个txt文档,并记录一些东西
最佳答案
- 五星知识达人网友:纵马山川剑自提
- 2021-03-21 06:57
Sub 另存()
Dim i As Long
Dim str As String
str = "C:\Documents and Settings\Administrator\桌面\"
For i = 1 To UsedRange.Rows.Count
Rows(i).Copy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:=str & ActiveWorkbook.Sheets(1).[a1] & ".txt", FileFormat:= _
xlUnicodeText, CreateBackup:=False '用每行的第一个单元格命名
ActiveWorkbook.Close False
Next i
End Sub
Dim i As Long
Dim str As String
str = "C:\Documents and Settings\Administrator\桌面\"
For i = 1 To UsedRange.Rows.Count
Rows(i).Copy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:=str & ActiveWorkbook.Sheets(1).[a1] & ".txt", FileFormat:= _
xlUnicodeText, CreateBackup:=False '用每行的第一个单元格命名
ActiveWorkbook.Close False
Next i
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯