|
- Sub 按钮1_Click()
- If Len([c3]) > 0 Then
- arr = Sheets(1).UsedRange
- Application.ScreenUpdating = False
- r = Cells(Rows.Count, 2).End(3).Row
- [b7].Resize(r, 6).ClearContents
- r = 7
- c = 5
- For j = 2 To UBound(arr)
- If arr(j, 1) = [c3] Then
- If InStr(arr(j, 3), ".") > 0 Then
- brr = Split(arr(j, 3), ".")
- crr = Split(arr(j, 4), ".")
- Cells(6, c) = arr(j, 2)
- If c = 5 Then
- r = 7
- Else
- r = Cells(Rows.Count, 2).End(3).Row + 1
- End If
- Cells(r, 2).Resize(UBound(brr) + 1) = WorksheetFunction.Transpose(brr)
- Cells(r, 3).Resize(UBound(crr) + 1) = WorksheetFunction.Transpose(crr)
- Cells(r, c).Resize(UBound(crr) + 1) = WorksheetFunction.Transpose(crr)
- c = c + 1
-
- Else
- If c = 5 Then
- r = 7
- Else
- r = Cells(Rows.Count, 2).End(3).Row + 1
- End If
- Cells(r, 2) = arr(j, 3)
- Cells(r, 3) = arr(j, 4)
- Cells(r, c) = arr(j, 4)
- c = c + 1
- End If
- End If
- Next j
- Application.ScreenUpdating = True
- End If
- End Sub
复制代码 |
|