By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,589 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Progress Bar in VBA(Excel)

NarenMCA
P: 12
Hi,

I want to use status bar control 6.0 in VBA(Excel). Other functions in the Macro will be performing some copy/paste and filtering operations. I want the progress bar to show status based on the tasks performed by those functions.

Can any one help me in this.

Thanks in advance,
Naren
Jun 20 '08 #1
Share this Question
Share on Google+
4 Replies


kadghar
Expert 100+
P: 1,295
i wouldnt recomend you to use controls other than the default ones. (txtbox, command button, etc)

in this case, i'd use the Excel's status bar to show the progress. Check this little example:

Expand|Select|Wrap|Line Numbers
  1. Sub StsBar()
  2.     Dim t As Single
  3.     t = Timer
  4.     Do
  5.         DoEvents
  6.         Application.StatusBar = Timer - t
  7.     Loop Until Timer > t + 10
  8. End Sub
  9.  
well, hth
Jun 20 '08 #2

NarenMCA
P: 12
i wouldnt recomend you to use controls other than the default ones. (txtbox, command button, etc)

in this case, i'd use the Excel's status bar to show the progress. Check this little example:

Expand|Select|Wrap|Line Numbers
  1. Sub StsBar()
  2.     Dim t As Single
  3.     t = Timer
  4.     Do
  5.         DoEvents
  6.         Application.StatusBar = Timer - t
  7.     Loop Until Timer > t + 10
  8. End Sub
  9.  
well, hth


Thanks for you suggestion.

But I am trying this because I just want to learn this.

-Naren
Jun 20 '08 #3

kadghar
Expert 100+
P: 1,295
Thanks for you suggestion.

But I am trying this because I just want to learn this.

-Naren
Yeah, well, then go to the Tools menu > Aditional Controls (inside the VBA editor)

there you'll have to add some Microsoft Progress Bar control (and check the library that contains it, so when you run this macro in some others' office, it might tell you that you need an specific library, in that case, you'll have to go to the tools menu > references, and browse the file to add it, in most cases that file is already in most of computers, but just in case, make sure you know where to download it or have a copy in a pen drive)

Once you've added it, it'll be in your tools menu and you can use its method and properties as it were any other control.

HTH
Jun 20 '08 #4

kadghar
Expert 100+
P: 1,295
And i forgot to say

check te first example i wrote using DoEvents, you may find it useful, just change the control instead of the Excel's statusbar.
Jun 20 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.