|
楼主 |
发表于 2021-8-3 07:48
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub test()
Dim i%, j%, k%, arr, arr1
arr = Sheet1.[a1].CurrentRegion
j = 2
For i = 2 To UBound(arr)
With Sheets(2)
Sheets(1).Activate
Range(Cells(i, 2), Cells(i, 4)).Copy .Cells(j, 1)
If InStr(arr(i, 5), "<") Then
arr1 = Split(arr(i, 5), "<")
.Cells(j, 4) = arr1(0): j = j + 1
For k = 1 To UBound(arr1)
.Cells(j, 1) = Split(arr1(k), "(")(0)
.Cells(j, 2) = Split(Replace(arr1(k), ")", "("), "(")(1)
.Range(.Cells(j - 1, 3), .Cells(j - 1, 4)).Copy .Cells(j, 3)
j = j + 1
Next
Else
Sheet1.Cells(i, 5).Copy .Cells(j, 4)
j = j + 1
End If
End With
Next
End Sub
这个代表怎样改成ACCESS代码?各位老师指导一下 |
|