您好,首先,到这里求助并不会让人觉得可耻,不懂就要问吗。
做了一下,用vba弄的,初步检查了一下,运行ok、
行政办.zip
(21.42 KB, 下载次数: 15)
- Sub 处理()
- Dim Arr, Brr(1 To 10000, 1 To 40), drow%, dcol%, i%, j%, Trr, mmax%
- With Worksheets("原始记录")
- drow = .[a65536].End(3).Row
- dcol = .[iv1].End(xlToLeft).Column
- Arr = .Range(.Cells(2, 1), .Cells(drow, dcol))
- m = 1: mmax = 1
- For i = 1 To UBound(Arr)
- Brr(m, 1) = Arr(i, 1): Brr(m, 2) = Arr(i, 2): Brr(m, 3) = Arr(i, 3)
- mmax = 1
- For j = 4 To UBound(Arr, 2)
- If Arr(i, j) <> "" Then
- Trr = Split(Arr(i, j), " ")
- For k = 1 To UBound(Trr)
- Brr(m + k - 1, j) = Trr(k)
- Next
- mmax = WorksheetFunction.Max(UBound(Trr), mmax)
- End If
- Next
- m = m + mmax
- Next
- End With
- With Worksheets("目标")
- .Range("a2:ak10000").ClearContents
- .[a2].Resize(m, 40) = Brr
- End With
- MsgBox "处理完毕"
- End Sub
复制代码 |