|
用宏代码:将C列内容拆分到H列,第一行做标题,拆分放在第二行开始。其它内容用VLOOKUP公式解决。
Private Sub Workbook_Open()
Dim a, ary, arr, brr(), i&, j%, m&
With Range("C1:C" & [C65536].End(xlUp).Row)
ary = .Value
.Replace "/", " ", xlPart
.Replace "-", " ", xlPart
arr = .Value
ReDim brr(1 To UBound(arr) * 2, 0)
For i = 1 To UBound(arr)
If Len(arr(i, 1)) Then
a = Split(arr(i, 1), " ")
For j = 0 To UBound(a)
If IsNumeric(a(j)) Then
m = m + 1
brr(m, 0) = a(j)
End If
Next
End If
Next
.Value = ary
End With
[H:H].ClearContents
[H2].Resize(m) = brr
End Sub
|
|