Refreshing the screen

secici

New Member
Joined
Sep 21, 2002
Messages
43
I am hiding the objects that I want by writing a

Code:
Public Sub HideObject()  
Dim SShape As Shape  

For Each SShape In pgeSales.Shapes
  If Left(SShape.Name, 3) = "cmb" Then
      SShape.Visible = False    
  End If  
Next 
End Sub

function... But -I do not know why- some objects remain appear. And If I minimize and remaximize the page they go. I think this is a typical "Refreshing the screen" problem.

From the helps I've found sth like "object.Repaint" that I think it to be related with the topic. But I couldn't be succesful on applying the method by coding "worksheets(1).repaint".

Could you help me...

Thanks...
This message was edited by secici on 2002-09-23 00:22
This message was edited by secici on 2002-09-23 00:22
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

tusharm

MrExcel MVP
Joined
May 28, 2002
Messages
11,029
You can try -- no guarantees -- two things.

The first is:<pre>
Application.ScreenUpdating=False
{your code here}
Application.ScreenUpdating=True</pre>
and also,<pre>
{your code here}
DoEvents</pre>
 

secici

New Member
Joined
Sep 21, 2002
Messages
43
Then practically, what could it be the way to make all the comboboxes on my worksheet invisible?

This is a considerably important point because I want to learn how to deal with all the objects which depends on a particular class -namely combobox- within a single loop.
 

tusharm

MrExcel MVP
Joined
May 28, 2002
Messages
11,029
I am not sure what it is that you want. Did you try the code I suggested? Did it work? If not, how not?
 

secici

New Member
Joined
Sep 21, 2002
Messages
43
Yeah;

I had already tried the "ScreenUpdating" before you posted the reply. I' ve tried the "DoEvents" but it did not work either...
 

guiness

New Member
Joined
Apr 2, 2004
Messages
4
I had a similar problem when refreshing pivots via combo-boxes and the "currentpage" property.

I fixed it by capturing "activesheet.name" to string variable "startSheet" right after the "screenupdating=false" and using "sheets(startSheet).select" after the "screenupdating=true".

PS

This actually worked better when I put the "sheets(startSheet).select" line right before the "screenupdating=true".

So...

Code:
Application.ScreenUpdating = False
startSheet = activesheet.name

..(your code)..

sheets(startsheet).select
Application.ScreenUpdating = True
[/code]
 

Forum statistics

Threads
1,144,148
Messages
5,722,792
Members
422,458
Latest member
Muirzy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top