Any tips to reduce lines, improve speed, or any cool thing, are welcome.
I have been using this for years and I just realized, why not improve ...?
Sub AtualizarRelatorioGeral()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
SaveChanges = False
Dim Arquivo(18) As String
Arquivo(1) = "zpp03ontem"
Arquivo(2) = "vl10a"
Arquivo(3) = "mb51consumomensal"
Arquivo(4) = "mb51repassegerado"
Arquivo(5) = "mb52peixerev"
Arquivo(6) = "mb52peixepro"
Arquivo(7) = "mb52exp"
Arquivo(8) = "mb52repassesaldo"
Arquivo(9) = "zsd17"
Arquivo(10) = "zsd25fat"
Arquivo(11) = "zsd25dev"
Arquivo(12) = "mc.9estoquecd"
Arquivo(13) = "mc.9consumo"
Arquivo(14) = "mc.9centro"
Arquivo(15) = "mc.9cdhipet"
Arquivo(16) = "mc.9valor"
Arquivo(17) = "zpp25"
Arquivo(18) = "mc.9produto"
For i = 1 To 18
Sheets(Arquivo(i)).Visible = True
Next i
Set WBgeral = ActiveWorkbook
'IMPORTAR ARQUIVOS
For i = 1 To 18
WBgeral.Activate
Sheets(Arquivo(i)).Activate
Cells.Select
Selection.Clear
Workbooks.OpenXML ("C:\macrosm\prerelatoriolucimara\" & Arquivo(i) & ".xls")
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
WBgeral.Activate
Sheets(Arquivo(i)).Activate
ActiveSheet.Paste
Workbooks(Arquivo(i)).Close SaveChanges:=False
Next i
'IMPORTAR ARQUIVOS
Sheets("Principal").Activate
For i = 1 To 18
Sheets(Arquivo(i)).Visible = False
Next i
Cells(4, 16).Value = Date
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.DisplayAlerts = True
SaveChanges = True
End Sub