Solved

Progress bar

Posted on 2012-03-14
5
246 Views
Last Modified: 2012-03-16
Hi,

I have a user form that performs a few actions, some of these can take a few minutes. I want to show the user that something is happening as the egg timer flicks on and off.

I have previously used user forms to create a progress bar and updated that everytime a module finished. I dont really want to be building multiple user forms to show the progress.

Is there a simple way i cant show that something is happening to the user, then when the sub finished, the signal ends

Thanks
Seamus
0
Comment
Question by:Seamus2626
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:kgerb
ID: 37720364
I have used Alain's.  It's attractive and works well.  All the heavy lifting is already done.  You just have to implement it.

Article

Make sure you click 'yes' if you like it and use it.

Kyle
0
 
LVL 10

Expert Comment

by:Mez4343
ID: 37720381
What about using the Status bar in bottom left corner of excel window?

http://www.vbaexpress.com/kb/getarticle.php?kb_id=87
0
 

Author Comment

by:Seamus2626
ID: 37720442
Hey Mez, i would prefer something more visible.

Kyle, i dont understand how thias code will know when my sub has finished its actions?

Thanks
Seamus
0
 
LVL 12

Accepted Solution

by:
kgerb earned 500 total points
ID: 37720543
Seamus,
You have to configure the progress bar before you use it and tell it how many iterations you are going to run.  Then, while you are looping through your iterations you have to update the status of the progress bar.  

This example is copied directly from the article.
Sub wasteTime()
    Dim i As Long
    Dim diag As New ProgressDialogue
    diag.Configure "Wasting Time", "Now wasting your time...", -10000, 10000
    diag.Show
    For i = -10000 To 10000
        diag.SetValue i
        diag.SetStatus "Now wasting your time... " & i
        If diag.cancelIsPressed Then Exit For
    Next i
    diag.Hide
End Sub

Open in new window

Line 4 configures the progress bar with a title, a comment, a min value, and a max value.
Line 7 updates the progress bar with a new value.

Hope this helps.  If you need more explanation let me know.

Kyle
0
 

Author Closing Comment

by:Seamus2626
ID: 37728823
Thank you Kyle

All good
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now