PDA

View Full Version : no blinking when running and progress bar



mqdias
10-14-2011, 09:55 AM
Hi,

I have a little application in VBA that takes about 1 minute to be finished.
When running, the screen "blinks" because de application makes some changes between sheets wich generates that blink.

Is there any way that i can fix the current sheet where i have the command button and run the application without changes between sheets and also put some progress bar to be shown during the run so the user can see the progress?

Thanks!

jaydee
10-14-2011, 10:46 AM
You can add a status bar which keeps users informed of progress during a lengthy macro. It looks something like this


Sub ShowMessage()
Dim lCounter As Long
Application.ScreenUpdating = False
For lCounter = 0 To 100000000
If lCounter Mod 1000000 = 0 Then
Application.StatusBar = “Processing Record “ & lCounter
End If
Next lCounter
Application.StatusBar = False
End Sub

mqdias
10-14-2011, 04:10 PM
dear jaydee

Thanks for the reply.

In my VBA when i copy this code the part "Application.StatusBar = “Processing Record “ & lCounter " appears in red and gives me a compile error.

Can you tell me what is going on?

Thnak you very much

Paul_Hossler
10-14-2011, 06:05 PM
Make sure you don't " 's around the statement:


Application.StatusBar = “Processing Record “ & lCounter


and that you have lCounter spellect the same in the Dim and in the .Statusbar statements

Paul

GTO
10-14-2011, 09:31 PM
mqdias,

You started this thread here at approximately 0955 hours here, and at approximately 0959 hours Here (http://www.mrexcel.com/forum/showthread.php?t=585727)

I'm sure you'll agree that 4 minutes is hardly enough time before cross-posting. Please read this (http://www.excelguru.ca/node/7)

mqdias
10-15-2011, 02:41 AM
Dear GTO,

First, sorry for that, it was not with bad intentions.

Second, i don't see why i can't post in another forums. From the user point of view, as much help as i can get, the better is for me and i can obtain different answers for the same problem.

For example, you also participate in 2 forums. Is that wrong??? I don't see why.

But this is just an opinion.

Thank you very much for the help to all anyway.

Aussiebear
10-15-2011, 03:56 AM
Hi mqdias,

We are not saying that you can't post in multiple forums, but if you feel the need to do so, then out of courtesy to the members of the forums where you have posted the same issue,you really need to also post the cross link.

Many people are active members of a number of forums, and this is a very good thing. It helps to spread the knowledge around by sharing the experiences gained. May I suggest that if you take the time to read the article provided by GTO though his link "http://www.excelguru.ca/node/7", you will gain a good understanding of the issue.

mqdias
10-15-2011, 05:06 AM
Ok. sorry to all.

I wasn't familiar with that procedure.
Next time i will post also the link to other forums with the same post.

Thanks.

omp001
10-15-2011, 05:28 AM
Hello, Dias.
Try to delete the quotation marks and retype them in the line of code where the problem lies.