? on running Sub's at once on where to add Application.ScreenUpdating = False

zone709

Well-known Member
Joined
Mar 1, 2016
Messages
2,062
Office Version
  1. 365
Platform
  1. Windows
So below I run 2 subs at once. I'm just trying to figure out where to put the screenupdating false and true. Do I put it in both Sub's or add it right here. The sub test20 runs fin. I do not see a flash or blink, but when the code below runs Macro1. The excel screen flashes once ?

Sub TradeRun()
Sub Test20()
Sub Macro1() <--- do I add it here?
End Sub

Code:
Sub Macro1() 'Scroll down columns & add number 6 to row'
    Range("R3:S3").AutoFill Destination:=Range("R3:S56"), Type:=xlFillDefault
    Range("R3:S56").Select
    Range("R61:S61").AutoFill Destination:=Range("R61:S114"), Type:=xlFillDefault
    Range("R61:S114").Select
    Range("R119:S119").AutoFill Destination:=Range("R119:S172"), Type:=xlFillDefault
    Range("R119:S172").Select
    Range("R177:S177").AutoFill Destination:=Range("R177:S230"), Type:=xlFillDefault
    Range("R177:S230").Select
    Range("R235:S235").AutoFill Destination:=Range("R235:S288"), Type:=xlFillDefault
    Range("R235:S288").Select
    Range("R293:S293").AutoFill Destination:=Range("R293:S346"), Type:=xlFillDefault
    Range("R293:S346").Select
    Range("R351:S351").AutoFill Destination:=Range("R351:S404"), Type:=xlFillDefault
    Range("R351:S404").Select
    Range("R409:S409").AutoFill Destination:=Range("R409:S462"), Type:=xlFillDefault
    Range("R409:S462").Select
    Range("R467:S467").AutoFill Destination:=Range("R467:S520"), Type:=xlFillDefault
    Range("R467:S520").Select
    Range("R3").Select
End Sub
 

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
Setting Application.ScreenUpdating to False affects overall Excel. Try to set it to False in Immediate Window - and you won't see the cells' selection.
 
Upvote 0
Hi I did this and now I don't see the screen flashing?

Code:
Sub Scroll1() 'Scroll down columns & add number 6 to row'
 Application.ScreenUpdating = False
    Range("R3:S3").AutoFill Destination:=Range("R3:S56"), Type:=xlFillDefault
    Range("R3:S56").Select
    Range("R61:S61").AutoFill Destination:=Range("R61:S114"), Type:=xlFillDefault
    Range("R61:S114").Select
    Range("R119:S119").AutoFill Destination:=Range("R119:S172"), Type:=xlFillDefault
    Range("R119:S172").Select
    Range("R177:S177").AutoFill Destination:=Range("R177:S230"), Type:=xlFillDefault
    Range("R177:S230").Select
    Range("R235:S235").AutoFill Destination:=Range("R235:S288"), Type:=xlFillDefault
    Range("R235:S288").Select
    Range("R293:S293").AutoFill Destination:=Range("R293:S346"), Type:=xlFillDefault
    Range("R293:S346").Select
    Range("R351:S351").AutoFill Destination:=Range("R351:S404"), Type:=xlFillDefault
    Range("R351:S404").Select
    Range("R409:S409").AutoFill Destination:=Range("R409:S462"), Type:=xlFillDefault
    Range("R409:S462").Select
    Range("R467:S467").AutoFill Destination:=Range("R467:S520"), Type:=xlFillDefault
    Range("R467:S520").Select
    Range("R3").Select
     Application.ScreenUpdating = True
End Sub
 
Upvote 0
To avoid flickering, AVOID selections! Everything can be done without selecting. Moreover, without selecting, the code will execute much faster.
 
Upvote 0
One last thing cause I'm still new at this. If I remove .Select it wont run I get compile

Code:
    Range("R3:S3").AutoFill Destination:=Range("R3:S56"), Type:=xlFillDefault
    Range("R3:S56").Select

    Range("R3:S3").AutoFill Destination:=Range("R3:S56"), Type:=xlFillDefault
    Range("R3:S56") <-- but what else and I missing?
 
Upvote 0
Remove the whole line, it is just...

Code:
    Range("R3:S3").AutoFill Destination:=Range("R3:S56"), Type:=xlFillDefault
    Range("R61:S61").AutoFill Destination:=Range("R61:S114"), Type:=xlFillDefault

In fact you can even remove the
Code:
Destination:=
 
Last edited:
Upvote 0
Generaly, one would use code like this

Code:
Sub Master()
  
    Application.ScreenUpdating = False

    Call Macro1
    Call Macro2

    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thanks I used all you guys input and tighten it up,.
 
Upvote 0

Forum statistics

Threads
1,203,099
Messages
6,053,523
Members
444,669
Latest member
Renarian

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