保存时文件名与原文件名相同;且将内容按空格分列(.txt文件中格式相同)
时间:2023-07-21 14:13:48
在一个文件夹中有数百个.txt文件,想将其另存为.xls文件,保存时文件名与原文件名相同;且将内容按空格分列(.txt文件中格式相同),使用VBA可以实现该功能,代码如下:
Dim Fso, Fl
Set Fso = CreateObject("Scripting.FileSystemObject")
For Each Fl In Fso.getfolder(ThisWorkbook.Path & "").Files
If Fl.Name <> ThisWorkbook.Name Then
Workbooks.OpenText (Fl)
With ActiveWorkbook
.SaveAs ThisWorkbook.Path & "" & Fl.Name & ".xls"
标签:分列,文件,文件名,空格,Excel教程
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
word2007无法打印怎么回事
2023-11-30 01:57:12
![](https://img.aspxhome.com/file/2023/7/18747_0s.jpg)
word怎么横纵混排
2023-10-12 07:02:04
![](https://img.aspxhome.com/file/2023/8/34578_0s.png)
excel2003填充柄的使用方法
2022-07-06 07:23:50
win11安装助手安装的是正式版吗?
2022-02-17 16:59:46
![](https://img.aspxhome.com/file/2023/1/a278084_0s.png)
excel透视表怎么选择数据和增加计算列
2023-06-04 17:37:24
Win7语言栏不见了怎么办?Win7系统找回语言栏的方法
2023-12-04 16:14:00
![](https://img.aspxhome.com/file/2023/28/a243542_0s.jpg)
微信添加好友失败有哪些原因?
2023-11-16 12:14:15
![](https://img.aspxhome.com/file/2023/8/a339899_0s.jpg)
如何解决网页上不能输入文字的问题
2023-05-19 21:01:04
![](https://img.aspxhome.com/file/2023/5/a319294_0s.jpg)
怎么在朗读女中清除缓存?朗读女清除缓存的方法
2022-09-23 21:57:20
![](https://img.aspxhome.com/file/2023/7/a329741_0s.jpg)
飞书会议打开摄像头有没有上限?飞书会议人数有限制吗?
2023-10-04 10:41:55
![](https://img.aspxhome.com/file/2023/30/a265818_0s.png)
能让Wi-Fi提速10倍的是啥大法?MIT替你想到了
2023-03-31 15:45:23
![](https://img.aspxhome.com/file/2023/3/a300423_0s.png)
如何使用Syncios Data Recovery直接从 iOS 设备恢复数据?
2023-03-26 21:51:43
![](https://img.aspxhome.com/file/2023/5/a206065_0s.jpeg)
在Word2003文档中如何插入excel表格?
2023-03-06 20:32:04
![](https://img.aspxhome.com/file/2023/6/24306_0s.jpg)
Win10专业版如何查看显卡信息?
2023-11-22 03:07:47
![](https://img.aspxhome.com/file/2023/5/50255_0s.png)
雷云3宏设置使用教程
2022-03-29 12:31:06
![](https://img.aspxhome.com/file/2023/1/a281420_0s.png)
Word2010四级标题的目录该怎么制作?
2023-11-12 13:21:03
![](https://img.aspxhome.com/file/2023/0/17890_0s.jpg)
WPS文字2013在打印的时候怎么设置装订线
2022-04-18 12:17:26
word怎么将编号设置为上标?编号怎么设置为上标教程
2023-04-12 22:51:34
![](https://img.aspxhome.com/file/2023/30/a269785_0s.png)
window10怎么关闭安全启动?window10安全启动怎么关
2022-06-03 12:50:05
![](https://img.aspxhome.com/file/2023/30/a265339_0s.jpg)
Win10系统自带ie浏览器在哪?
2023-02-05 17:54:04
![](https://img.aspxhome.com/file/2023/5/a316667_0s.jpg)