Excel2000 VBA ループ内の処理件数をステータスバーに表示する [Excel2000 VBA独習]
Excel2000 VBA ループ内の処理件数をステータスバーに表示する
cnt=0
For i=1 To end_count
処理
cnt = cnt + 1
'ステータスバーに表示
Application.StatusBar = "処理実行中 " & cnt & "/" & end_count & "件"
next i
'ステータスバーの表示を消す
Application.StatusBar = False
ESCキーを押して途中で終了する
Application.EnableCancelKey = xlErrorHandler
On Error GoTo ESC
cnt=0
For i=1 To end_count
処理
cnt = cnt + 1
'ステータスバーに表示
Application.StatusBar = "処理実行中 " & cnt & "/" & end_count & "件"
next i
'ステータスバーの表示を消す
Application.StatusBar = False
Exit Sub
ESC:
MsgBox ("終了します")
Application.StatusBar = False
End Sub
コメント 0