Hello all,
Here is the situation, i have the following code that I'm running. The code moves sheets from one workbook to another and then adds VBA coding to a few of the sheets. My question is the following, is there any code that prevents a person from visually seeing the code run its parts. What i mean is that when i run the code it shows opening up the other workbook, moving the sheets over, opening the editor window, adding code to the sheets, and then closing the editor window. All might make the person running feel like there is an issues. Is there any way of say having the screen freeze and then have all the items run int he background and then when the screen unfreezes, all the changes have been made. Here is the code i'm running in case there is something i can add to it to make this happen.
As you can see i tried using the ScreenUpdating to prevent this but it doesn't quite do what i want it to do.
Here is the situation, i have the following code that I'm running. The code moves sheets from one workbook to another and then adds VBA coding to a few of the sheets. My question is the following, is there any code that prevents a person from visually seeing the code run its parts. What i mean is that when i run the code it shows opening up the other workbook, moving the sheets over, opening the editor window, adding code to the sheets, and then closing the editor window. All might make the person running feel like there is an issues. Is there any way of say having the screen freeze and then have all the items run int he background and then when the screen unfreezes, all the changes have been made. Here is the code i'm running in case there is something i can add to it to make this happen.
VBA Code:
Sub WBOpenMod()
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim fName
Dim wbATL As Workbook
fName = ActiveWorkbook.Path & "\Agreement Tracking Log.xlsx"
Select Case fName = Empty
Case False
Set wbATL = Workbooks.Open(fName)
wbATL.Sheets("Final Map").Move Before:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
wbATL.Sheets("Tract Parcels").Move Before:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
wbATL.Sheets("Permits").Move Before:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
wbATL.Sheets("NOC").Move Before:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
wbATL.Sheets("Security").Move Before:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
wbATL.Sheets("Contact").Move Before:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
wbATL.Sheets("Contact (ST)").Move Before:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
wbATL.Sheets("DATA").Move Before:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
Call AddFMCode
Call AddTPCode
Call AddSTCode
Call AddNOCCode
wbATL.Save
wbATL.Close
WbOpen = True
End Select
ThisWorkbook.VBProject.VBE.MainWindow.Visible = False
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.DisplayAlerts = True
End Sub
As you can see i tried using the ScreenUpdating to prevent this but it doesn't quite do what i want it to do.