https://cloud.tencent.com/developer/article/1870629?share_token=9370A677-6904-40B6-8C06-8EE6D07ECE8B&tt_from=copy_link&utm_source=copy_link&utm_medium=toutiao_ios&utm_campaign=client_share
循环进度条
Option Explicit
Sub test()
Dim i, max
max = 10
For i = 1 To max
Application.StatusBar = GetProgress(i, max)
Call sleep
Next
End Sub
Function GetProgress(curValue, maxValue)
Dim i As Single, j As Integer, s As String
Dim m, n
i = maxValue / 20
j = curValue / i
For m = 1 To j
s = s & "■"
Next m
For n = 1 To 20 - j
s = s & "□"
Next n
GetProgress = s & FormatNumber(curValue / maxValue * 100, 2) & "%"
End Function
Sub sleep()
Dim newHour, newMinute, newSecond, waitTime
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 1.5
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
End Sub
循环进度条——窗体版
https://cloud.tencent.com/developer/article/1534613
https://m.toutiao.com/is/FHfmaFN/
VBA实战技巧30:创建自定义的进度条1