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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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>
 
Upvote 0
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.
 
Upvote 0
I am not sure what it is that you want. Did you try the code I suggested? Did it work? If not, how not?
 
Upvote 0
Yeah;

I had already tried the "ScreenUpdating" before you posted the reply. I' ve tried the "DoEvents" but it did not work either...
 
Upvote 0
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]
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,592
Members
449,089
Latest member
Motoracer88

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
Back
Top