fredlo2010
05-23-2012, 08:22 PM
Hello,
Is there a way to avoid screen flickering when copying from a workbook to another.
I have a code and it does the work its supposed to but the screen issue is the problem here.
here is my code
Sub AddSystems(varColumns As String)
'ROUTINE TO ADD THE SYSTEMS TO THE MAIN TABLE
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Call ClearContents
Workbooks.Open Filename:="C:\Quick\Reference Workbook.xlsx"
Sheets("Systems").Activate
Range(varColumns & 2, Range(varColumns & Rows.Count).End(xlUp)).Copy
Windows("Quick BOM.v1.3.xlsm").Activate
ActiveWorkbook.Sheets("Appendix Data").Activate
Range("A4").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Windows("Reference Workbook.xlsx").Activate
ActiveWorkbook.Close
Range("A1").Select
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
and my code under my form that triggers this code
Private Sub CommandButton1_Click()
If Systemsbttn1 = True Then
Call AddSystems("A")
End If
Systems.Hide
End Sub
Is there a way to avoid screen flickering when copying from a workbook to another.
I have a code and it does the work its supposed to but the screen issue is the problem here.
here is my code
Sub AddSystems(varColumns As String)
'ROUTINE TO ADD THE SYSTEMS TO THE MAIN TABLE
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Call ClearContents
Workbooks.Open Filename:="C:\Quick\Reference Workbook.xlsx"
Sheets("Systems").Activate
Range(varColumns & 2, Range(varColumns & Rows.Count).End(xlUp)).Copy
Windows("Quick BOM.v1.3.xlsm").Activate
ActiveWorkbook.Sheets("Appendix Data").Activate
Range("A4").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Windows("Reference Workbook.xlsx").Activate
ActiveWorkbook.Close
Range("A1").Select
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
and my code under my form that triggers this code
Private Sub CommandButton1_Click()
If Systemsbttn1 = True Then
Call AddSystems("A")
End If
Systems.Hide
End Sub