|
- Option Explicit
- ' 不考虑第9行数据发票号不同的情况,不需要使用字典对象
- Sub Demo()
- Dim i As Long, j As Long
- Dim arrData, rngData As Range
- Dim arrRes, iR As Long
- Dim LastRow As Long, aCol
- aCol = Array(0, 1, 3)
- Set rngData = ActiveSheet.Range("A1").CurrentRegion
- arrData = rngData.Value
- For i = LBound(arrData) To UBound(arrData)
- If InStr(1, arrData(i, 3), ",") > 0 Then
- For j = 0 To UBound(aCol)
- arrData(i, 3 + aCol(j)) = Split(arrData(i, 3 + aCol(j)), ",")(0)
- Next
- End If
- Next i
- Sheets.Add
- rngData.Copy Range("A1")
- Range("A1").CurrentRegion.Value = arrData
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|