ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform. (https://www.excelbanter.com/excel-programming/373043-userform.html)

Bill[_30_]

Userform.
 
Hello,
I have the code given below to show a userform. When the userform comes up,
I can select and move it around the screen. But it keeps its image at each
location, so it is like there are hundreds of userforms on the screen if I
keep moving it around. I thought turning the screen updating to true would
prevent that. Any thoughts?

Application.ScreenUpdating = True
CHUpdate.Show
CHUpdate.Hide
Application.ScreenUpdating = False

Thanks,

Bill



JLGWhiz

Userform.
 
I'm trying to think of a good reason for even applying ScreenUpdating to a
UserForm?

"Bill" wrote:

Hello,
I have the code given below to show a userform. When the userform comes up,
I can select and move it around the screen. But it keeps its image at each
location, so it is like there are hundreds of userforms on the screen if I
keep moving it around. I thought turning the screen updating to true would
prevent that. Any thoughts?

Application.ScreenUpdating = True
CHUpdate.Show
CHUpdate.Hide
Application.ScreenUpdating = False

Thanks,

Bill




Bob Phillips

Userform.
 
Here is a post from Andy Pope that MIGHT help

Activating cells on a hidden sheet whilst the userform is displayed will
cause ghosting if you move the userform.

I suggest you confirm this by simply making the sheet visible and then
move your userform around. If the problem goes away you will need to
alter your code. You can still reference and use the cells on the hidden
sheet just not activate them. Most tasks do not require you to activate
the cells in order to manipulate them.


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Bill" wrote in message
ink.net...
Hello,
I have the code given below to show a userform. When the userform comes

up,
I can select and move it around the screen. But it keeps its image at

each
location, so it is like there are hundreds of userforms on the screen if I
keep moving it around. I thought turning the screen updating to true

would
prevent that. Any thoughts?

Application.ScreenUpdating = True
CHUpdate.Show
CHUpdate.Hide
Application.ScreenUpdating = False

Thanks,

Bill





Tom Ogilvy

Userform.
 
That should solve the problem. This problem is usually caused by
ScreenUpdating being set to false.

--
Regards,
Tom Ogilvy

"Bill" wrote in message
ink.net...
Hello,
I have the code given below to show a userform. When the userform comes
up, I can select and move it around the screen. But it keeps its image at
each location, so it is like there are hundreds of userforms on the screen
if I keep moving it around. I thought turning the screen updating to true
would prevent that. Any thoughts?

Application.ScreenUpdating = True
CHUpdate.Show
CHUpdate.Hide
Application.ScreenUpdating = False

Thanks,

Bill




kataiwo

Userform.
 
I think the problem is because the form is shown modal by default and because
of this, your code actually stalls at the point you show the form. Showing
the form modeless should solve the problem as below:
myform.show vbmodeless
--
kataiwo


"Tom Ogilvy" wrote:

That should solve the problem. This problem is usually caused by
ScreenUpdating being set to false.

--
Regards,
Tom Ogilvy

"Bill" wrote in message
ink.net...
Hello,
I have the code given below to show a userform. When the userform comes
up, I can select and move it around the screen. But it keeps its image at
each location, so it is like there are hundreds of userforms on the screen
if I keep moving it around. I thought turning the screen updating to true
would prevent that. Any thoughts?

Application.ScreenUpdating = True
CHUpdate.Show
CHUpdate.Hide
Application.ScreenUpdating = False

Thanks,

Bill





Tom Ogilvy

Userform.
 
If you want to show it modal, then turning on screenupdating will solve the
problem in my experience.

--
Regards,
Tom Ogilvy


"kataiwo" wrote in message
...
I think the problem is because the form is shown modal by default and
because
of this, your code actually stalls at the point you show the form. Showing
the form modeless should solve the problem as below:
myform.show vbmodeless
--
kataiwo


"Tom Ogilvy" wrote:

That should solve the problem. This problem is usually caused by
ScreenUpdating being set to false.

--
Regards,
Tom Ogilvy

"Bill" wrote in message
ink.net...
Hello,
I have the code given below to show a userform. When the userform
comes
up, I can select and move it around the screen. But it keeps its image
at
each location, so it is like there are hundreds of userforms on the
screen
if I keep moving it around. I thought turning the screen updating to
true
would prevent that. Any thoughts?

Application.ScreenUpdating = True
CHUpdate.Show
CHUpdate.Hide
Application.ScreenUpdating = False

Thanks,

Bill








All times are GMT +1. The time now is 07:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com