I have scoured the internet looking for some good status bar examples, the problem is, I've found too many.
I figure rather than wasting my time, I'd ask sir Hans if he knew of any good status bar code.
You may recall the payroll entry form where the user can select many employees at once to enter their employee work hours. Well, if all employees are selected, the process can take up to 20 sec. or so to complete. I'd like to add a status bar to this event if possible.
Status / Loading Bar
-
- 3StarLounger
- Posts: 206
- Joined: 31 Dec 2010, 22:23
- Location: Columbia Falls, MT
-
- Administrator
- Posts: 78647
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Status / Loading Bar
It's quite simple, actually: before a lengthy operation, insert this line:
Application.StatusBar = "Processing worked hours. This may take some time."
and after it, clear the status bar using
Application.StatusBar = False
If you have a loop, you can provide detailed information:
This will display e.g.
Processing worked hours for employee 5 of 37
Application.StatusBar = "Processing worked hours. This may take some time."
and after it, clear the status bar using
Application.StatusBar = False
If you have a loop, you can provide detailed information:
Code: Select all
n = ...
For i = 1 To n
Application.StatusBar = "Processing worked hours for employee " & i & " of " & n
...
...
Next i
Application.StatusBar = False
Processing worked hours for employee 5 of 37
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 206
- Joined: 31 Dec 2010, 22:23
- Location: Columbia Falls, MT
Re: Status / Loading Bar
Thanks Hans...maybe it's a bit early here, but what would the "N" represent?
I got it, thanks.
I got it, thanks.
-
- Administrator
- Posts: 78647
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Status / Loading Bar
n would be the total number of items to process (e.g. the number of selected items in a list box, or ...)
Best wishes,
Hans
Hans