|
参与一下。。。- Sub ykcbf() '//2024.3.17
- Dim arr, d
- Application.ScreenUpdating = False
- ReDim brr(1 To 1000, 1 To 4)
- With Sheets("数据源")
- arr = .[a1].Resize(14, 13)
- dh = arr(1, 3)
- For i = UBound(arr) To 3 Step -2
- p2 = arr(i - 1, 1)
- For j = 3 To UBound(arr, 2)
- If arr(i, j) <> Empty Then
- m = m + 1
- brr(m, 1) = dh
- brr(m, 2) = p2
- brr(m, 3) = arr(i - 1, j)
- brr(m, 4) = arr(i, j)
- End If
- Next
- Next
- arr = .[a17].Resize(10, 8)
- dh = arr(1, 3)
- For i = UBound(arr) To 3 Step -2
- p2 = arr(i - 1, 1)
- For j = 3 To UBound(arr, 2)
- If arr(i, j) <> Empty Then
- m = m + 1
- brr(m, 1) = dh
- brr(m, 2) = p2
- brr(m, 3) = arr(i - 1, j)
- brr(m, 4) = arr(i, j)
- End If
- Next
- Next
- End With
- With Sheets("提取数据")
- .[a2:d1000] = ""
- .[a1].Resize(1, 4).Interior.Color = 49407
- Set Rng = .[a2].Resize(m, 4)
- With Rng
- .Value = brr
- .Borders.LineStyle = 1
- .HorizontalAlignment = xlCenter '//列居中
- .VerticalAlignment = xlCenter
- End With
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|