Unable to stop screen updating

Cyd

Board Regular
Joined
May 15, 2009
Messages
84
I've tried using this code, 'Application.ScreenUpdating = False' and then 'True' at the end of my code, but it doesn't stop the flashing screens. The code switches between two separate files copying and pasting values from a file to the other.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Here's the code.

Code:
Sub Button3_Click()
'
' Button3_Click Macro
' Macro recorded 3/14/2010 by Cy D
'
'
ActiveWindow.ActivateNext
Sheets("Data").Select
Range("O21:Q25").Select
Selection.Copy
ActiveWindow.ActivateNext
Range("D31").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.ActivateNext
Range("O8:Q9").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.ActivateNext
Range("D36").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("D31:D37").Select
Application.CutCopyMode = False
Selection.Copy
Range("B31").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E31:E37").Select
Application.CutCopyMode = False
Selection.Copy
Range("B39").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("F31:F37").Select
Application.CutCopyMode = False
Selection.Copy
Range("B47").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B31:B53").Select
Application.CutCopyMode = False
Selection.Copy
Range("B2").Select
ActiveWindow.ActivateNext
Sheets("SSCSRpt").Select
ActiveWindow.ActivateNext
Sheets("Data").Select
End Sub
 
Last edited by a moderator:
Upvote 0
I'm not sure what you need with the code, but below is a little bit modified version.
Code:
Sub Button3_Click()

Application.ScreenUpdating = False

ActiveWindow.ActivateNext
Sheets("Data").Range("O21:Q25").Copy

ActiveWindow.ActivateNext
Range("D31").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

ActiveWindow.ActivateNext
Range("O8:Q9").Copy

ActiveWindow.ActivateNext
Range("D36").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Range("D31:D37").Copy

Range("B31").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Range("E31:E37").Copy

Range("B39").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Range("F31:F37").Copy

Range("B47").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Range("B31:B53").Copy
Range("B2").Select

ActiveWindow.ActivateNext

Sheets("SSCSRpt").Select
ActiveWindow.ActivateNext
Sheets("Data").Select

Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Hope this helps.

Regards
 
Upvote 0
It's strange, is not showing screen updating for me trying with 2 open files.

How many files do you have open?
 
Upvote 0
Hallo

If you do not find alternatives that will block the entire Windows code
Be careful to put at the end: LockWindowUpdate 0

Code:
Declare Function LockWindowUpdate Lib "user32" (ByVal hWnd As Long) As Long

Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long
    
Sub Test()
LockWindowUpdate FindWindowA("XLMAIN", Application.Caption)
'----------------------------------------------------------
'Code....
'----------------------------------------------------------
LockWindowUpdate 0
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,290
Members
452,902
Latest member
Knuddeluff

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