VBA Excel中的进度条 [英] Progress bar in VBA Excel
问题描述
我正在做一个需要从数据库进行大量数据更新的Excel应用程序,所以需要时间。我想在用户表单中创建一个进度条,并在数据更新时弹出。我想要的酒吧只是一个蓝色的酒吧左右移动,重复,直到更新完成,没有百分比需要。
我知道我应该使用 progressbar
控件,但我尝试了一段时间,但不能做到。
I'm doing a Excel app that needs a lot data updating from a database, so it takes time. I want to make a progress bar in a userform and it pops up when the data is updating. The bar I want is just a little blue bar moves right and left and repeats till the update is done, no percentage needed.
I know I should use the progressbar
control, but I tried for sometime but cant make it.
编辑:我的问题是使用 progressbar
控件,我不能看到条'进度',它只是在表单弹出时完成。我使用一个循环和 DoEvent
,但这不工作。另外,我希望这个过程重复一次,而不只是一次。
My problem is with the progressbar
control, I cant see the bar 'progress', it just complete when the form pops up. I use a loop and DoEvent
but that isn't working. Plus, I want the process to repeat, not just one time.
推荐答案
过去,使用VBA项目,使用背景颜色的标签控件,并根据进度调整大小。以下链接可以找到一些类似方法的例子:
In the past, with VBA projects, I've used a label control with the background colored and adjust the size based on the progress. Some examples with similar approaches can be found in the following links:
- http://oreilly.com/pub/h/2607
- http://www.ehow.com/how_7764247_create-progress-bar-vba.html
- http://spreadsheetpage.com/index.php/tip/displaying_a_progress_indicator/
- http://oreilly.com/pub/h/2607
- http://www.ehow.com/how_7764247_create-progress-bar-vba.html
- http://spreadsheetpage.com/index.php/tip/displaying_a_progress_indicator/
这里是使用Excel的自动形状:
Here is one that uses Excel's Autoshapes:
http://www.andypope.info/vba/pmeter.htm
这篇关于VBA Excel中的进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!