|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
代码如下。。。。
Sub test()
Dim wb As Workbook, sht As Worksheet
Set wb = ThisWorkbook
Set sht = wb.Sheets("sheet1")
arr = sht.[a1].CurrentRegion
ReDim brr(1 To 1000, 1 To 4)
n = 0
For i = 0 To arr(2, 3) - arr(2, 1)
n = n + 1
brr(n, 1) = arr(2, 1) + i: brr(n, 3) = arr(2, 1) + i
brr(n, 2) = arr(2, 2): brr(n, 4) = arr(2, 4)
Next
sht.[h1].CurrentRegion.Clear
sht.[h1].Resize(, UBound(arr, 2)) = arr
sht.[h2].Resize(n, UBound(arr, 2)) = brr
sht.Range("i:i,k:k").NumberFormat = "h:mm"
Beep
End Sub
|
评分
-
1
查看全部评分
-
|