|
- Sub Test()
- Dim arr, brr(1 To 100000, 1 To 1), crr(1 To 100000, 1 To 1), i, n, m
- arr = Range("a1:a" & Cells(Rows.Count, 1).End(3).Row)
- For i = 1 To UBound(arr) - 3
- If arr(i, 1) = "坐标" And arr(i + 1, 1) = "X" Then
- n = n + 1
- brr(n, 1) = arr(i + 2, 1)
- End If
- If arr(i, 1) = "坐标" And arr(i + 3, 1) = "Y" Then
- m = m + 1
- crr(m, 1) = arr(i + 4, 1)
- End If
- Next
- Range("j1").Resize(Rows.Count, 2).ClearContents
- Range("j1").Resize(1, 2) = Array("X", "Y")
- Range("j2").Resize(n) = brr
- Range("k2").Resize(m) = crr
- MsgBox "完成"
- End Sub
复制代码 |
|