Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Bar count lines of code 1

Status
Not open for further replies.

smma

Mechanical
Jun 4, 2007
24
Hello! I woud like to make a progress bar hack that uses the width of a textbox as the size of the bar. My question is how can I have the progress bar show while my macros are working in the background? Additionally, I would like the bar to increment for each line of code read, so the progress would be relevant to the code being processed. Has anyone found a good way to do this? I have found several examples online, but nothing that will encompass these criteria. Or, would a regular ProgressBar control in VBA be the best choice? Thank you for your input!
 
Replies continue below

Recommended for you

Umm, updating a control requires a line of code. You want to update the control each time a line of code is processed. Your program will do nothing but update the progress bar.
 
So how do I update the control as each line is processed? That is what I am unsure of. I would like my Progress Bar (or TextBox) width to change for each line of code processed. What I don't know is how to read a line of code as a number and send it to the bar to change its width. Additionally, is there a way to run both the foreground Progress Bar and the background macro simultaneously? Thanks.
 
Huh? Each line of code, you increment a counter.

TTFN

FAQ731-376
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor