Excel如何用VBA把A1列的内容写入到TXT文本里
展开全部
Sub 宏1()
'
' 宏1 宏
'
' 快捷键: Ctrl+q
'
Dim i As Long
Dim abc, xtxt, n
Set abc = CreateObject("scripting.filesystemobject")
Set ntxt = abc.opentextfile("d:\n.txt", 8, True)
ntxt.writeline n '数据写入文本文档"d:\n.txt"
For i = 1 To 100
ntxt.writeline Range("A" & i).Value
Next i
ntxt.Close
Set abc = Nothing
End Sub
'
' 宏1 宏
'
' 快捷键: Ctrl+q
'
Dim i As Long
Dim abc, xtxt, n
Set abc = CreateObject("scripting.filesystemobject")
Set ntxt = abc.opentextfile("d:\n.txt", 8, True)
ntxt.writeline n '数据写入文本文档"d:\n.txt"
For i = 1 To 100
ntxt.writeline Range("A" & i).Value
Next i
ntxt.Close
Set abc = Nothing
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询