|
本帖最后由 hwc2ycy 于 2013-1-30 16:04 编辑
- Sub test()
- Dim arr, arrTemp, arrLen&, Item, Col&
- Dim LastRow&, jRow&
- LastRow = Cells(Rows.Count, 2).End(xlUp).Row
- Range("j1", Cells(1, Columns.Count).End(xlToLeft)).EntireColumn.ClearContents
- arr = Range("b1:b" & LastRow)
- jRow = Cells(Rows.Count, "j").End(xlUp).Row
- Application.ScreenUpdating = False
- Col = 9
- For Each Item In arr
- If InStr(Item, "#") Then
- Col = Col + 1
- jRow = Cells(Rows.Count, Col).End(xlUp).Row
- End If
- If Item Like "### *" Then
- Item = Replace(Item, " ", " ")
- arrTemp = Split(Item, " ")
- arrLen = UBound(arrTemp) + 1
- Cells(jRow, Col).Resize(arrLen) = WorksheetFunction.Transpose(arrTemp)
- jRow = jRow + arrLen
- End If
- Next
- Application.ScreenUpdating = True
- MsgBox "提取完成"
- End Sub
复制代码 |
|