|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
'参与一下
'45楼附件,I列数据写完过程才结束,,,
Option Explicit
Dim flag(1) As Boolean
Private Sub CommandButton1_Click()
Dim i, j, arr
If flag(0) Then flag(1) = Not flag(1): Exit Sub Else flag(0) = True
With Sheets("sheet1")
arr = .Range("i1:n" & .[i1].End(xlDown).Row)
For i = 1 To UBound(arr, 1)
If i = 1 Then .[b21].Resize(20 + UBound(arr, 1) + 1, UBound(arr, 2)).ClearContents
For j = 1 To UBound(arr, 2)
.Cells(20 + i, j + 1) = arr(i, j)
Next
Call delay(1) '延时1s,自己修改
Do
DoEvents
Loop Until flag(1) = False
Next
End With
flag(0) = False: flag(1) = False
End Sub
Function delay(tm)
Dim t
t = Timer
Do
DoEvents
Loop Until Timer - t >= tm
End Function |
评分
-
2
查看全部评分
-
|