- Sub qs()
- Dim arr, i
- With Sheet1
- arr = .Range("a1").CurrentRegion.Value
- ReDim brr(1 To UBound(arr), 1 To 7)
- m = 1: cl = 1
- For i = 2 To UBound(arr)
- If cl > 8 Then
- cl = 1
- m = m + 2
- brr(m, cl) = arr(1, 1) & ":" & arr(i, 1) & " " & arr(1, 2) & ":" & arr(i, 2) & " " & arr(1, 3) & ":" & arr(i, 3) & " " & arr(1, 4) & ":" & arr(i, 4)
- cl = cl + 2
- Else
- brr(m, cl) = arr(1, 1) & ":" & arr(i, 1) & " " & arr(1, 2) & ":" & arr(i, 2) & " " & arr(1, 3) & ":" & arr(i, 3) & " " & arr(1, 4) & ":" & arr(i, 4)
- cl = cl + 2
- End If
- Next
- End With
- Sheet2.Range("a1").Resize(m, 7) = brr
- End Sub
复制代码 |