macros excel unir hojas

Upload: horacio-jesus-prado-garcia

Post on 14-Feb-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/23/2019 Macros Excel Unir Hojas

    1/1

    Sub todas()'por luismondeloApplication.DisplayAlerts = FalseFor Each hoja In ActiveWorkbook.SheetsIf hoja.Name = "todas" Then hoja.DeleteNextSheets.Add before:=Sheets(1)ActiveSheet.Name = "todas"For x = 2 To Sheets.CountSheets(x).SelectRange("a1:o" & Range("a65000").End(xlUp).Row).CopySheets("todas").Range("a65000").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlValuesNextSheets("todas").SelectEnd Sub