|
楼主 |
发表于 2018-9-29 15:30
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub lqxs()
Dim a() As String, b() As String, i&, j&, n&, d
Set d = CreateObject("Scripting.Dictionary")
Open ThisWorkbook.Path & "\1.txt" For Input As #1
a = Split(StrConv(InputB(LOF(1), 1), vbUnicode), vncrlf)
For i = 0 To UBound(a)
If a(i) <> "" Then
b = Split(a(i))
d(b(1)) = i
End If
Next
Close #1
Arr = [a1].CurrentRegion
For i = 6 To UBound(Arr)
If d.exists(Arr(i, 2)) Then
n = d(Arr(i, 2))
b = Split(a(n))
For j = 0 To UBound(b)
Cells(i, j + 1) = b(j)
Next
这段代码输入好了,可是并没有什么反映啊 |
|