[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 407
  • Last Modified:

Application Screen updating

Hi,

I have a sub below, i have wrapped the sub, but it still shows me bits of what its doing, whereas it should be sticking on the sheet "Pic"

Any suggestions?

I dont want to see any updates.....

Thanks

Sub RunReport()


    Sheets("Pic").Visible = True
    Sheets("Pic").Select
    
    Application.ScreenUpdating = False


    OpenFiles

    ClearSheets
    
    DoTheWork
    
    SaveFiles
    
    Sheets("Pic").Visible = 2
    
    Sheets("Admin").Select
    
    MsgBox "Report is complete and files are saved"
    
Application.ScreenUpdating = True

End Sub

Open in new window

0
Seamus2626
Asked:
Seamus2626
1 Solution
 
krishnakrkcCommented:
On each sub include these line of codes

    Dim blnSUpdating    As Boolean
    
    With Application
        blnSUpdating = .ScreenUpdating
        .ScreenUpdating = False
    End With
    
    'your code
    
    
    Application.ScreenUpdating = blnSUpdating

Open in new window


Kris
0
 
NorieCommented:
If it's what's happening in the subs ebring called that you are seeing it's hard to suggest anything specific without seeing the code in those subs.

Are you selecting/activating anything in those subs?
0
 
Andrew VelascoCommented:
You could also try opening your other files first, then setting Screen Updating to false.
0
 
Seamus2626Author Commented:
Hi,

I found the sub, its an old recorded macro that i integrated to the procedure

But at the start of the sub i have

Application.ScreenUpdating = False


Thanks

Sub DoTheWork()


Application.ScreenUpdating = False
    
    Windows("master.xlsm").Activate
    Sheets("Sheet1").Select
    ActiveSheet.UsedRange.Clear
    Windows("MonthlyDownload.xlsx").Activate
    Sheets("Sheet1").Select
    ActiveSheet.UsedRange.Copy
    Windows("master.xlsm").Activate
    Sheets("Sheet1").Select
    Range("A1").Select
    ActiveSheet.Paste
    
    With ActiveSheet
    If .AutoFilterMode = True And .FilterMode = True Then ActiveSheet.ShowAllData
    End With
    

    

    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=3, Criteria1:= _
        "PB Slides English"
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=7, Criteria1:= _
        "=Expired", Operator:=xlOr, Criteria2:="=Requires Review"
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="ASP"
    Range("$A$1:$G$20000").Select
    Selection.Copy
    Windows("Asia.xlsm").Activate
    Sheets("PB Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    DateStamp
    Windows("master.xlsm").Activate
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="EUROPE"
    Range("$A$1:$G$20000").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Europe.xlsm").Activate
    Sheets("PB Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    DateStamp
    Windows("master.xlsm").Activate
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="LATAM"
    Range("$A$1:$G$20000").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("LATAM.xlsm").Activate
    Sheets("PB Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    DateStamp
    Windows("master.xlsm").Activate
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="ME"
    Range("$A$1:$G$20000").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("MENA.xlsm").Activate
    Sheets("PB Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    DateStamp
    Windows("master.xlsm").Activate
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="NA"
    Range("$A$1:$G$20000").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("NA.xlsm").Activate
    Sheets("PB Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    DateStamp
    Windows("master.xlsm").Activate
    Rows("1:1").Select
    Application.CutCopyMode = False
    ActiveSheet.ShowAllData
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=3, Criteria1:= _
        "PM 2012 CONTENT"
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=7, Criteria1:= _
        "=Expired", Operator:=xlOr, Criteria2:="=Requires Review"
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="ASP"
    Range("$A$1:$G$20000").Select
    Selection.Copy
    Windows("Asia.xlsm").Activate
    Sheets("PM Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    Windows("master.xlsm").Activate
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="EUROPE"
    Range("$A$1:$G$20000").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Europe.xlsm").Activate
    Sheets("PM Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    Windows("master.xlsm").Activate
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="LATAM"
    Range("$A$1:$G$20000").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("LATAM.xlsm").Activate
    Sheets("PM Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    Windows("master.xlsm").Activate
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="ME"
    Range("$A$1:$G$20000").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("MENA.xlsm").Activate
    Sheets("PM Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    Windows("master.xlsm").Activate
    ActiveSheet.Range("$A$1:$G$20000").AutoFilter Field:=4, Criteria1:="NA"
    Range("$A$1:$G$20000").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("NA.xlsm").Activate
    Sheets("PM Review").Select
    Range("A1").Select
    ActiveSheet.Paste
    Windows("master.xlsm").Activate
    Sheets("Sheet1").Select
    With ActiveSheet
    If .AutoFilterMode = True And .FilterMode = True Then ActiveSheet.ShowAllData
    End With
    

Open in new window

0
 
Seamus2626Author Commented:
Perfect!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now