Repaint causes form to flicker

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a user form which has a calandar on it for the user to enter a date and then click a button to run a macro. I also have a progress indicator on it which displays the four or five steps the macro takes and has a percentage next to it indicating how far along it is. I have screenupdating off and use the repaint feature to update the percentage. The problem is that the repaint causes the form to flicker a lot. Is there a way around this

The progress indicator may be a crude way of doing it
for count = 1 to activesheet.usedrange.rows.coun
a=a+
userform.label = format(a/count,"0%"
userform.repain
code..

I thought I might make a new form for the progress indication (currently the progress indication is a part of the user form). Is there a better way BESIDES the application.statusbar ? Thanks
 
Hi Chad;
You can try:
for count = 1 to activesheet.usedrange.rows.count
a=a+1
DoEvents
userform.label = format(a/count,"0%")
code...

MP

Chad said:
I created a user form which has a calandar on it for the user to enter a
date and then click a button to run a macro. I also have a progress
indicator on it which displays the four or five steps the macro takes and
has a percentage next to it indicating how far along it is. I have
screenupdating off and use the repaint feature to update the percentage.
The problem is that the repaint causes the form to flicker a lot. Is there
a way around this?
The progress indicator may be a crude way of doing it:
for count = 1 to activesheet.usedrange.rows.count
a=a+1
userform.label = format(a/count,"0%")
userform.repaint
code...

I thought I might make a new form for the progress indication (currently
the progress indication is a part of the user form). Is there a better way
BESIDES the application.statusbar ? Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top