如何将excel里的数据导出为txt文件
2个回答
展开全部
在此excel文件中,同时按alt和f11进入宏界面,点菜单的插入,模块,粘贴如下代码:
sub
test()
application.screenupdating
=
false
dim
i
as
integer
chdrive
"d:"
for
i
=
1
to
range("a9999").end(xlup).row
-
1
rows(i).copy
workbooks.add
activesheet.paste
activeworkbook.saveas
"
d:\
"
&
thisworkbook.activesheet.range("a"
&
i)
&
".txt",
xlunicodetext
activeworkbook.close
next
i
application.screenupdating
=
true
end
sub
在此界面直接按f5运行此宏,完成。(建议你改为比如d:\abc\之类的)
sub
test()
application.screenupdating
=
false
dim
i
as
integer
chdrive
"d:"
for
i
=
1
to
range("a9999").end(xlup).row
-
1
rows(i).copy
workbooks.add
activesheet.paste
activeworkbook.saveas
"
d:\
"
&
thisworkbook.activesheet.range("a"
&
i)
&
".txt",
xlunicodetext
activeworkbook.close
next
i
application.screenupdating
=
true
end
sub
在此界面直接按f5运行此宏,完成。(建议你改为比如d:\abc\之类的)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |