I have the following code that copies a worksheet from a closed workbook to a worksheet in my open workbook. On the user worksheet (Main), I have a button the user clicks which updates all my vba. I don't want the code to show the user any worksheets it's working on but it seems to jump to the "NotifTasks" worksheet with this code below. Anyone know how to fix the "jumping" and keep it on the "Main" worksheet? Or is this even possible in Excel?
Sub Updatewb()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Sheets("Report 1").Delete
Const fromFile = "\\fol0ns01\xfer\MRO_Databases\JobTracker\NotifTasks.xlsx"
Dim srcBook As Workbook
Set srcBook = Application.Workbooks.Open(fromFile, _
UpdateLinks:=False, _
ReadOnly:=True, _
AddToMRU:=False)
srcBook.Sheets("Report 1").Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
Sheets("Report 1").Select
Cells.Select
Selection.Copy
Sheets("NotifTasks").Select
Cells.Select
ActiveSheet.Paste
srcBook.Close False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Sub Updatewb()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Sheets("Report 1").Delete
Const fromFile = "\\fol0ns01\xfer\MRO_Databases\JobTracker\NotifTasks.xlsx"
Dim srcBook As Workbook
Set srcBook = Application.Workbooks.Open(fromFile, _
UpdateLinks:=False, _
ReadOnly:=True, _
AddToMRU:=False)
srcBook.Sheets("Report 1").Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
Sheets("Report 1").Select
Cells.Select
Selection.Copy
Sheets("NotifTasks").Select
Cells.Select
ActiveSheet.Paste
srcBook.Close False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub