Lesson 8 - Progress Bar Coding

Coding the Progress Bar

In this lesson we cover:

  • How to show the Progress Bar from a VBA subroutine (ProgressBar.Show)
  • Using a Sleep command to pause your program for X milliseconds (e.g. 50 ms)
  • Creating a For Loop to test the Progress Bar
  • Step by step walkthrough (using F8) to show how Progress Bar gets updated
  • How to use “On Error GoTo Error_Handler” to catch run-time error (type mismatch) when Progress Bar is closed

Using the Progress Bar for real

When you use the Progress Bar in real programs you don’t include the sleep…

Instead you put in your own code and use a For loop to track progress through your steps.

I’ll include a Progress Bar in the final Module where we’ll look at a complete working VBA program. (See Module 10)


Further Learning on User Forms: Excel Power Programming with VBA

If you are interested in learning more about User Forms I suggest you pick up a copy of the book “Excel Power Programming with VBA” in the Mr. Spreadsheet series published by Wiley.

When I created this course (2017) the latest edition was “Excel 2016 Power Programming with VBA” and authored by Michael Alexander and Dick Kusleika.

This book has 3 full chapters dedicated to User Forms and goes beyond the material covered in this course.

It includes details of how to get user input from User Forms as well as more advanced User Form techniques.

You will find it easier to understand the book now that you have watched me create a User Form in this module!

Write your comments and feedback below

  • If you have questions or comments about this lesson, write it in the section below.
  • Alternatively you can email the instructor Victor at [email protected]

Complete and Continue  
Discussion

0 comments