怎么要VBA实现从文本.TEXT 里把数据读取到EXCEL 里
答案:2 悬赏:0 手机版
解决时间 2021-01-25 07:11
- 提问者网友:原来太熟悉了会陌生
- 2021-01-24 11:49
怎么要VBA实现从文本.TEXT 里把数据读取到EXCEL 里
最佳答案
- 五星知识达人网友:春色三分
- 2021-01-24 13:25
简单的用Workbooks.OpenText方法直接将文本文件打开到EXCEL表格中。也可用 Open 语句打开文本文件,然后再读取内容放到表格中
全部回答
- 1楼网友:未来江山和你
- 2021-01-24 14:17
’这里有分呀,由于规律不是很明显就随便给你写点:
sub test()
dim arr, brr, i as long, s
arr = split("equipment user cavity center1x center1y center1 center2x center2y center2")
[a1].resize(1, ubound(arr) + 1) = arr
brr = arr
open "c:\123.txt" for input as #1
arr = split(strconv(inputb(lof(1), 1), vbunicode), vbnewline)
close #1
brr(0) = split(arr(1), "=")(1): brr(1) = split(arr(2), "=")(1): brr(2) = split(arr(4), "=")(1)
s = split(arr(10), "=")(1): s = split(s, ",")
for i = 0 to 2
brr(i + 3) = s(i)
next
s = split(arr(12), "=")(1): s = split(s, ",")
for i = 0 to 2
brr(i + 6) = s(i)
next
[a2].resize(1, ubound(brr) + 1) = brr
end sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯