LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default HELP: display status bar on excel userforms

controls have a property called 'tag' that isn't used.

You should put a sequence of numbers in each that you want the student to
use, so that they are tagged 1,2,3 .... and so on

then each time a control is entered or left, you call a process that checks
the tagged controls to see how many are yet to be used. This can also be a
way to enable controls.
so set enabled for all the tagged controls to false
set the control with the tag value 1 to true

you can then, in your status bar loop enable the next control.

I have 5 text boxes, tagged 1 to 5 with 2 thro 5 disabled.
changing a value in 1, enables 2. Changing 2 enables 3 ...

Option Explicit
Private Sub TextBox1_Change()
enablenext TextBox1.Tag
End Sub
Private Sub TextBox2_Change()
enablenext TextBox2.Tag
End Sub
Private Sub TextBox3_Change()
enablenext TextBox3.Tag
End Sub
Private Sub TextBox4_Change()
enablenext TextBox4.Tag
End Sub
Sub enablenext(Box As Long)
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.Tag = Box + 1 Then
ctrl.Enabled = True
Exit For
End If
Next
End Sub





"sam" wrote:

Hey EricG, Thanks for your help.

The status bar is updating when I click on the userform, BUT it doesnt
update the status when i populate the textboxes, dropdowns, option buttons
that i have on the form. Am i missing something here?

Thanks in advance

"EricG" wrote:

Here is an example of how to add a progress bar to a user form. Follow the
steps below.

1. Start with a new workbook for this example.
2. Open the Visual Basic Editor (Tools/Macro/Visual Basic Editor)
3. From the menu, Insert/UserForm (named UserForm1 by default)
4. From the menu, Tools/Additional Controls..., find and check the
"Microsoft ProgressBar Control"
5. Open UserForm1 in form view to edit it.
6. From the Toolbox, select the ProgressBar control. Draw a ProgressBar
control on the userform. Named ProgressBar1 by default.
7. Also on the userform, add a new text label, named Label1 by default.
8. Right-click on UserForm1, select "View Code"
9. Enter the code below. Watch out for line breaks!
10. "Run" the form by clicking the Run button on the Debug tool bar, or
from the Run menu. Click anywhere in UserForm1 (other than ProgressBar1 or
Label1), and the value of the progress bar will advance until it reaches 100.
The text label will also update.


Option Explicit

Private Sub UserForm_Click()
Me.ProgressBar1.Value =
Application.WorksheetFunction.Min(Me.ProgressBar1. Value + 5, 100)
Me.Label1.Caption = Format(Me.ProgressBar1.Value / 100#, "0%")
Me.Repaint
DoEvents
End Sub

This example shows you how to update the value of the progress bar, and how
to use a text label to show the value of the bar as a text string. Adapt the
example to your needs.

HTH,

Eric

"sam" wrote:

Hi All,

I have a userform for students where they input their data, attach their hw,
and submit their hw..

Now I want to show them "Status bar" kind of object where they know how far
they are in their process..

So for eg, If they launch the form, The status bar should should 0% and say
(pleas populate your details), once they fill in their details the status bar
should show 30% and say (please attach your hw), once they attach their hw,
the submit button is enabled.. then the status bar should show 60% and say
(please submit your hw)
Once they click submit the status bar should show 100% and say (Success! Hw
submitted)

Can this be done in excel userform?

Thanks in advance



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I display status bar value in Excel 2007 Al B Excel Discussion (Misc queries) 1 March 11th 07 12:35 AM
display status bar value in excel userform? Al B Excel Discussion (Misc queries) 0 November 15th 06 01:21 PM
Status Bar does not display in Excel 7.0 Frank Excel Programming 5 September 21st 06 07:03 PM
How do I change the display options in the status bar of MS Excel Baffled Excel Discussion (Misc queries) 1 November 15th 05 05:34 PM
display count/results of filtering Excel in status bar JayDax Excel Discussion (Misc queries) 2 July 21st 05 11:41 PM


All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"