|
|
EXCEL状态栏,试了一下写入信息及进度条演示:
- Sub InputMsgtoBar()
- Dim i As Long, total As Long, barLength As Integer
- Dim progressBar As String
- Dim msg As String
- msg = "这是一个测试..."
- Application.StatusBar = msg
- Application.Wait Now + TimeValue("0:00:03")
- Application.StatusBar = False
- msg = "正在处理数据,请稍候..."
- Application.StatusBar = msg
- Application.Wait Now + TimeValue("0:00:03")
- total = 10
- barLength = 30 ' 进度条长度
- For i = 1 To total
- progressBar = String(Int(i / total * barLength), "■") & _
- String(barLength - Int(i / total * barLength), " ")
- Application.StatusBar = "进度: " & progressBar & " " & Format(i / total, "0%")
- Application.Wait Now + TimeValue("0:00:01")
- Next i
- Application.StatusBar = False
- End Sub
复制代码
|
|