repeated screen "blinking" problem when running program - please help!

G

gunman

Hello All!! ;)

I have created a small VB program in excel to calculate a number base
on about 5-6 given numerical inputs. This program also use
IF...Then....ElseIf logic by taking some of the inputs and based on th
values, routing the inputs to different equation sets for calculation
Anyway, I have setup two ways for Excel to calculate the correc
output: one, is by pushing a button that prompts each numeric input i
an application box and second, by inputting the values into the correc
cells manually and then clicking on the output text box (the code i
based off of the "GotFocus" feature for the textbox). However, here i
the problem!! When the user inputs using the button method everythin
works fine. However, when inputting using the manual method into eac
cell and then clicking on the textbox, the screen starts to rapidl
blink over and over again and will not stop until the user click
somewhere else on the screen. The program then spits out the value int
the textbox. The answer is right but this is dreadfully annoying. *DOE
ANYONE KNOW HOW TO KEEP THIS BLINKING FROM HAPPENING?
 
S

STEVE BELL

Without seeing your code I can only guess.

Maybe you have some kind of loop happening in your code?
If there are event macros they could be firing repeatedly:

use - prevent events being fired during code
Application.EnableEvents = False
[ your code ]
Application.EnableEvents = True

Maybe your code is going through a number of steps and causing the screen to
change

use - to freeze the screen until the code is complete
Application.ScreenUpdating = False
[ your code ]
Application.ScreenUpdating = True
 
G

Gary Keramidas

use this before your code
Application.ScreenUpdating = False

and this after it is done
Application.ScreenUpdating = True
 
G

gunman

Thanks for the input on how to stop the blinking problem. Ill give it a
try and report back if it worked or not.
Gunman
 
G

gunman

Thanks guys. The application.enable events feature worked great and
everything is solved. Thanks again

Gunman
 

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

Top