I am trying copy data in column B for all of the sheets for 2006-2013 to all years sheet. I tried making this code which only does for one year. Is there is any way i can automate this so that the copies data from all the sheets and paste in all years according to years. I am not really that good with VBA just learning. I want to keep using xldown for the code though as it is an requirement for my work
Sub CreateSheet()
' Add sheet allyears
Sheets.Add.Name = "allyears"
End Sub
Private Sub RunTask1()
'copy data from 2006 to allyears
Sheets("year2006").Activate
Range("A11:B11").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("allyears").Activate
ActiveCell.PasteSpecial xlPasteValues
ActiveSheet.Select
Columns("A").ColumnWidth = 25
ActiveSheet.Rows.AutoFit
End Sub
Bookmarks