Consolidate data from multiple tabs into one (same workbook)

1

I have 18 worksheets (tabs) with user data and I need to copy and paste the data into another worksheet (tab) in the consolidated name. I need to copy the header only from the first worksheet and at the end remove the empty lines.

It's all in one workbook only. The closest scenario I got was this but it's very slow:

Sub juntarfim()
    '
    Range("A1").Select
    Sheets("PLANILHA1").Select
    Range("A5:E500").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("CONSOLIDADOJUNTOS").Select
    ActiveSheet.Paste
    '
    Range("A501").Select
    Sheets("PLANILHA2").Select
    Range("A6:E500").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("CONSOLIDADOJUNTOS").Select
    ActiveSheet.Paste
    '
End sub
    
asked by anonymous 15.06.2018 / 00:12

1 answer

0
Sub juntarfim()

Application.ScreenUpdating = False 'desativa atualização de tela.
Range("A1").Select
Sheets("PLANILHA1").Select
Range("A5:E500").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("CONSOLIDADOJUNTOS").Select
ActiveSheet.Paste
'
Range("A501").Select
Sheets("PLANILHA2").Select
Range("A6:E500").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("CONSOLIDADOJUNTOS").Select
ActiveSheet.Paste
'
End sub
    
06.08.2018 / 21:31