Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: display status bar on excel userforms
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: display status bar on excel userforms
a nice way is to have two labels, one on top of the other
the one 'below' will be the frame - so have borders but no interior color the one 'above' should be sized to fit just inside the one below, but with no borders a filled with blue. when the form opens set the 'inner' width to zero when you want to show say 30%, set the inner width to 30% on the one below "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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: display status bar on excel userforms
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: display status bar on excel userforms
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: display status bar on excel userforms
Hey Pat, I tried taging the textboxes but when i update them it still doesnt
update the status bar.. So basically I tagged the textboxes and used this code Private Sub UserForm_Click() Me.ProgressBar1.Value = Application.WorksheetFunction.Min(Me.ProgressBar1. Value + 5, 100) Me.Label26.Caption = Format(Me.ProgressBar1.Value / 100#, "0%") Me.Repaint DoEvents End Sub Do I need to write something that would make it happen? Thanks in advance "Patrick Molloy" wrote: 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 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: display status bar on excel userforms
Also, I dont want to use the enable function rite now, maybe for next
release.. But rite now I just want to get this status bar working. "Patrick Molloy" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I display status bar value in Excel 2007 | Excel Discussion (Misc queries) | |||
display status bar value in excel userform? | Excel Discussion (Misc queries) | |||
Status Bar does not display in Excel 7.0 | Excel Programming | |||
How do I change the display options in the status bar of MS Excel | Excel Discussion (Misc queries) | |||
display count/results of filtering Excel in status bar | Excel Discussion (Misc queries) |